瀏覽代碼

鑫动力,鑫畅途 2023.11.21

caojunjie 2 年之前
父節點
當前提交
08b68f8b1b

+ 9 - 0
api/tabBar/home.js

@@ -62,4 +62,13 @@ export const brandDescDetail = (data) => {
 		method: 'GET',
 		params: data
 	})
+}
+
+// 库存查询
+export const stockDescList = (data) => {
+	return http.request({
+		url: '/blade-sales-part/stockDesc/list',
+		method: 'GET',
+		params: data
+	})
 }

+ 9 - 0
api/tabBar/shoppingCart.js

@@ -57,4 +57,13 @@ export function update(ids) {
 			ids:ids
 		}
 	})
+}
+
+// 获取调哪个支付的接口
+export function paramserviceDetail(params) {
+	return http.request({
+		url: '/blade-system/paramservice/detail',
+		method: 'GET',
+		params
+	})
 }

+ 9 - 0
api/views/personalInformation/index.js

@@ -21,4 +21,13 @@ export function details(data) {
     url: '/blade-sales-part/corpsDesc/appDetails',
     method: 'get'
   })
+}
+
+// 查询是否一样
+export function corpsDescWhetherExistence(params) {
+  return http.request({
+    url: '/blade-sales-part/corpsDesc/whetherExistence',
+    method: 'get',
+	params
+  })
 }

+ 9 - 0
api/views/vehicle/brand.js

@@ -38,4 +38,13 @@ export function brandList(params) {
     method: 'get',
     params
   })
+}
+
+// 检索挑战
+export function goodsdescGetCnameInt(params) {
+  return http.request({
+    url: '/blade-client/goodsdesc/getCnameInt',
+    method: 'get',
+    params
+  })
 }

+ 9 - 7
common/setting.js

@@ -9,14 +9,16 @@ module.exports = {
 	// 版本号
 	version: '1.0.0',
 	// 开发环境接口Url
-	// devUrl: 'http://192.168.0.106:1080',
-	devUrl: 'http://192.168.8.108:1080',
-	// devUrl: 'https://td.echepei.com/api',
-	// devUrl: 'http://jxy.natapp1.cc/api',
+	// devUrl: 'http://192.168.0.111:1080',
+	// devUrl: 'http://192.168.8.107:1080',
+	devUrl: 'https://td.echepei.com/api',  // 鑫动力
+	// devUrl: 'https://lt.echepei.com/api',   // 鑫畅途的
+	// devUrl: 'http://jxy.natapp1.cc/api',
 	// devUrl: 'http://121.37.83.47:10004',
-	// 线上环境接口Url
+	// 线上环境接口Url
 	// prodUrl: 'http://121.37.83.47:10004',
-	prodUrl: 'https://td.echepei.com/api',
+	prodUrl: 'https://td.echepei.com/api', // 鑫动力
+	// prodUrl: 'https://lt.echepei.com/api', // 鑫畅途的
 	// prodUrl: 'http://192.168.1.111:1080',
 	// 后端数据的接收方式application/json;charset=UTF-8或者application/x-www-form-urlencoded;charset=UTF-8
 	contentType: 'application/json;charset=UTF-8',
@@ -30,4 +32,4 @@ module.exports = {
 	clientId: 'saber',
 	// 客户端密钥
 	clientSecret: 'saber_secret'
-}
+}

+ 2 - 1
manifest.json

@@ -131,7 +131,8 @@
             "postcss" : true,
             "minified" : true
         },
-        "usingComponents" : true
+        "usingComponents" : true,
+        "__usePrivacyCheck__" : true
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 10 - 1
pages.json

@@ -50,7 +50,16 @@
 		"style": {
 			"navigationBarTitleText": "设置"
 		}
-	}],
+	}    ,{
+            "path" : "pages/login/PrivacyPop/PrivacyPop",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"subPackages": [{
 		"root": "pages/views",
 		"pages": [{

+ 168 - 0
pages/login/PrivacyPop/PrivacyPop.vue

@@ -0,0 +1,168 @@
+<template>
+    <view class="privacy" v-if="showPrivacy">
+        <view class="content">
+            <view class="title">隐私保护指引</view>
+            <view class="des">
+                在使用当前小程序服务之前,请仔细阅读<text class="link" @tap="openPrivacyContract">{{ privacyContractName }}</text>。如你同意{{
+                    privacyContractName }},请点击“同意”开始使用。
+            </view>
+            <view class="btns">
+                <button class="item reject" @tap="exitMiniProgram">拒绝</button>
+                <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
+                    @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
+            </view>
+        </view>
+    </view>
+</template>
+  
+<script>
+export default {
+    data() {
+        return {
+            privacyContractName: '《XXX隐私保护引导》',
+            showPrivacy: false
+        }
+    },
+    methods: {
+		checkPrivacySetting(){
+			uni.getPrivacySetting({
+			      success: res => {
+					console.log("getPrivacySetting",res)
+					this.showPrivacy = true
+					this.privacyContractName = res.privacyContractName
+			        // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' }
+			   //      if (res.needAuthorization) {
+			   //        // 需要弹出隐私协议
+			   //          this.showPrivacy = false
+			   //      } else {
+						// this.showPrivacy = true
+			   //        // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用已声明过的隐私接口
+			   //        // wx.getUserProfile()
+			   //        // wx.chooseMedia()
+			   //        // wx.getClipboardData()
+			   //        // wx.startRecord()
+			   //      }
+			      },
+			      fail: () => {},
+			      complete: () => {}
+			})
+		},
+		// 打开隐私协议
+        openPrivacyContract() {
+            uni.openPrivacyContract({
+                fail: () => {
+                    uni.showToast({
+                        title: '遇到错误',
+                        icon: 'error'
+                    })
+                }
+            })
+        },
+        // 拒绝隐私协议
+        exitMiniProgram() {
+			console.log("拒绝隐私协议")
+			const that = this;
+            // 直接退出小程序
+            // wx.exitMiniProgram()
+			uni.showModal({
+				// 如果拒绝,我们将无法获取您的信息, 包括手机号、位置信息、相册等该小程序十分重要的功能,您确定要拒绝吗?
+				content: '您确定要拒绝吗?',
+				success: res => {
+					if (res.confirm) {
+						that.showPrivacy = false;
+						uni.exitMiniProgram({
+							success: () => {
+								console.log('退出小程序成功');
+							}
+						});
+					}
+				}
+			});
+        },
+        // 同意隐私协议
+        handleAgreePrivacyAuthorization() {
+           
+			wx.requirePrivacyAuthorize({
+			      success: (res) => {
+					  console.log(res,86);
+					  
+			        // 用户同意授权
+			        // 继续小程序逻辑
+					 this.showPrivacy = false
+			      },
+			      fail: () => {}, // 用户拒绝授权
+			      complete: () => {}
+			    })
+        }
+    }
+}
+</script> 
+  
+<style scoped> .privacy {
+     position: fixed;
+     top: 0;
+     right: 0;
+     bottom: 0;
+     left: 0;
+     background: rgba(0, 0, 0, .5);
+     z-index: 9999999;
+     display: flex;
+     align-items: center;
+     justify-content: center;
+ }
+ 
+ .content {
+     width: 632rpx;
+     padding: 48rpx;
+     box-sizing: border-box;
+     background: #fff;
+     border-radius: 16rpx;
+ }
+ 
+ .content .title {
+     text-align: center;
+     color: #333;
+     font-weight: bold;
+     font-size: 32rpx;
+ }
+ 
+ .content .des {
+     font-size: 26rpx;
+     color: #666;
+     margin-top: 40rpx;
+     text-align: justify;
+     line-height: 1.6;
+ }
+ 
+ .content .des .link {
+     color: #07c160;
+     text-decoration: underline;
+ }
+ 
+ .btns {
+     margin-top: 48rpx;
+     display: flex;
+ }
+ 
+ .btns .item {
+     justify-content: space-between;
+     width: 244rpx;
+     height: 80rpx;
+     display: flex;
+     align-items: center;
+     justify-content: center;
+     border-radius: 16rpx;
+     box-sizing: border-box;
+     border: none;
+ }
+ 
+ .btns .reject {
+     background: #f4f4f5;
+     color: #909399;
+ }
+ 
+ .btns .agree {
+     background: #07c160;
+     color: #fff;
+ }
+</style>

+ 68 - 55
pages/login/login.vue

@@ -28,12 +28,17 @@
 				height: auto;
 				margin: 0 auto 10rpx;" mode="widthFix"></image>
 			青岛途宝软件开发有限公司提供技术支持
-		</view>
+		</view>
+		<PrivacyPop ref="PrivacyPopck"></PrivacyPop>
 	</view>
 </template>
-<script>
+<script>
+	import PrivacyPop from './PrivacyPop/PrivacyPop.vue'
 	import md5 from '@/utils/md5.js'
-	export default {
+	export default {
+		components:{
+			PrivacyPop
+		},
 		data() {
 			return {
 				phone: '', //手机号码
@@ -43,10 +48,15 @@
 				checked: false,
 				lifeData: {},
 				logo: "/static/images/logo/logo.png",
-				checkboxValue1:[]
+				checkboxValue1:[],
 			}
+		},
+		onLoad() {
+			// this.$refs.PrivacyPopck.checkPrivacySetting();
+		},
+		onShow() {
+			
 		},
-		onShow() {},
 		methods: {
 			// 协议跳转
 			tiaozhuanxieyi(){
@@ -65,56 +75,59 @@
 				if (e.detail.errMsg == 'getPhoneNumber:ok') {
 					wx.login({
 						success(res) {
-							if (res.code) {
-								wx.getUserInfo({
-									success: function(rest) {
-										this_.$u.api.tokenTwo({
-											telCode: e.detail.code,
-											loginCode: res.code,
-											iv: rest.iv,
-											encryptedData: rest.encryptedData,
-											applets_id: uni.getAccountInfoSync().miniProgram.appId
-										}).then(rest => {
-											uni.showLoading({
-												title: '登录中',
-												mask: true
-											});
-											this_.$u.api.empowerToken({
-												username: rest.data.phoneNumber,
-												union_id: rest.data.unionid,
-												open_id: rest.data.openid,
-												applets_id: uni.getAccountInfoSync().miniProgram.appId,
-												password: md5('123456')
-											}).then(data => {
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: '登录成功',
-													position: "bottom",
-													mask: true
-												})
-												setTimeout(function() {
-													this_.$u.func.login(data)
-												}, 1000);
-											}).catch(err=>{
-												uni.hideLoading();
-												uni.showToast({
-													icon: 'none',
-													title: err.error_description,
-													position: "bottom",
-													mask: true
-												})
-											})
-										})
-									},
-									fail: res => {
-										uni.showToast({
-											icon: 'none',
-											title: '已拒绝授权,请重新授权',
-											position: "bottom"
-										})
-									}
-								})
+							if (res.code) {
+								this_.$u.api.tokenTwo({
+									telCode: e.detail.code,
+									loginCode: res.code,
+									iv: e.detail.iv,
+									encryptedData: e.detail.encryptedData,
+									applets_id: uni.getAccountInfoSync().miniProgram.appId
+								}).then(rest => {
+									uni.showLoading({
+										title: '登录中',
+										mask: true
+									});
+									this_.$u.api.empowerToken({
+										username: rest.data.phoneNumber,
+										union_id: rest.data.unionid,
+										open_id: rest.data.openid,
+										applets_id: uni.getAccountInfoSync().miniProgram.appId,
+										password: md5('123456')
+									}).then(data => {
+										uni.hideLoading();
+										uni.showToast({
+											icon: 'none',
+											title: '登录成功',
+											position: "bottom",
+											mask: true
+										})
+										setTimeout(function() {
+											this_.$u.func.login(data)
+										}, 1000);
+									}).catch(err=>{
+										uni.hideLoading();
+										uni.showToast({
+											icon: 'none',
+											title: err.error_description,
+											position: "bottom",
+											mask: true
+										})
+									})
+								})
+								// wx.getUserInfo({
+								// 	success: function(rest) {
+										
+								// 	},
+								// 	fail: res => {
+								// 		console.log(res,115);
+								// 		uni.showToast({
+								// 			icon: 'none',
+								// 			title: '已拒绝授权,请重新授权',
+								// 			position: "bottom"
+								// 		})
+								// 	}
+								// })
+								
 							} else {
 								uni.showToast({
 									icon: 'none',

+ 27 - 4
pages/tabBar/classification.vue

@@ -37,7 +37,9 @@
 											{{itemTwo.cname}}
 										</view>
 										<view style="color: #707070;font-size: 24rpx;">{{itemTwo.mallPrice}}</view>
-										<view style="color: #FD4B09;font-size: 24rpx;">库存:{{itemTwo.inventory}}</view>
+										<view style="color: #FD4B09;font-size: 24rpx;">
+											库存:{{Number(itemTwo.inventory) > 10?'充足':Number(itemTwo.inventory)}}
+										</view>
 									</view>
 								</view>
 							</view>
@@ -53,7 +55,10 @@
 	import {
 		listAll,
 		goodsList
-	} from '@/api/tabBar/classification.js'
+	} from '@/api/tabBar/classification.js'
+	import {
+		details,
+	} from '@/api/views/personalInformation/index.js'
 	export default {
 		data() {
 			return {
@@ -70,10 +75,28 @@
 					size: 10,
 					current: 1
 				},
-				search: {}
+				search: {},
+				checkStatus:null,
 			}
 		},
-		onShow() {
+		onShow() {
+			// 获取审核状态
+			details().then(res => {
+				this.checkStatus = res.data.checkStatus
+				uni.setStorageSync('checkStatus', res.data.checkStatus);
+				if (this.checkStatus != '通过') {
+					// uni.showToast({
+					// 	title: "当前用户未授权,请联系客服",
+					// 	icon: "none",
+					// 	mask:true
+					// });
+					uni.switchTab({
+						url:'/pages/tabBar/home'
+					})
+					return 
+				}
+			})
+			
 			listAll({type:'PP', enableOrNot:'1'}).then(res => {
 				this.tabbarTwo = res.data
 				this.page = {

+ 39 - 10
pages/tabBar/home.vue

@@ -3,7 +3,7 @@
 		<view class="search">
 			<view style="margin: 10rpx 20rpx;margin-top: 20rpx;">
 				<u-search placeholder="请输入商品名称" inputAlign="center" bgColor="#fff" shape="square" v-model="search.cname"
-					@search="searchButton" @custom="searchButton" :animation="true"></u-search>
+					@search="searchButton" @custom="searchButton" :animation="false"></u-search>
 			</view>
 			<view v-if="false" style="margin: -15rpx auto 10rpx auto;display: flex;padding: 0 20rpx;z-index: 999;" >
 				<u-tag :text="search.brandNmae" borderColor="#FD4B09" color="#FD4B09" plain size="medium" closable
@@ -82,7 +82,7 @@
 							style="width: 100%;height: 340rpx;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;">
 						</image>
 						<view style="width: calc(100% - 20rpx);margin: 0 auto;">
-							<u--text :text="item.cname" size="12"></u--text>
+							<u--text :text="item.cname" lines="2" size="12"></u--text>
 							<view style="display: flex;justify-content: space-between;margin: 5rpx auto;">
 								<view style="padding-top: 12rpx;">
 									<view v-if="item.billType == 0"
@@ -92,7 +92,7 @@
 										style="font-size: 16rpx;background-color: #5ac725;color: #fff;padding: 6rpx;border-radius: 6rpx;">
 										次日达</view>
 								</view>
-								<view style="color: #FD4B09;font-size: 40rpx;">¥{{item.mallPrice}}</view>
+								<view style="color: #FD4B09;font-size: 40rpx;">¥{{checkStatus == '通过'?item.mallPrice:'***'}}</view>
 							</view>
 						</view>
 					</view>
@@ -102,10 +102,11 @@
 				<block v-for="(item,index) in dataList" :key="index" v-if="index%2==1">
 					<view class="item" @click="choice(item,index)">
 						<image v-for="(ite,ind) in item.filesList" :key="ind" v-if="ite.version === '0'" :src="ite.url"
-							style="width: 100%;height: 340rpx;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;">
+							style="width: 100%;height: 340rpx;border-top-left-radius: 20rpx;
+							border-top-right-radius: 20rpx;">
 						</image>
 						<view style="width: calc(100% - 20rpx);margin: 0 auto;">
-							<u--text :text="item.cname" size="12"></u--text>
+							<u--text :text="item.cname" lines="2" size="12"></u--text>
 							<view style="display: flex;justify-content: space-between;margin: 5rpx auto;">
 								<view style="padding-top: 12rpx;">
 									<view v-if="item.billType == 0"
@@ -115,7 +116,7 @@
 										style="font-size: 16rpx;background-color: #5ac725;color: #fff;padding: 6rpx;border-radius: 6rpx;">
 										次日达</view>
 								</view>
-								<view style="color: #FD4B09;font-size: 40rpx;">¥{{item.mallPrice}}</view>
+								<view style="color: #FD4B09;font-size: 40rpx;">¥{{checkStatus == '通过'?item.mallPrice:'***'}}</view>
 							</view>
 						</view>
 					</view>
@@ -137,7 +138,10 @@
 	} from '@/api/tabBar/home.js'
 	import {
 		listAll
-	} from '@/api/tabBar/classification.js'
+	} from '@/api/tabBar/classification.js'
+	import {
+		details,
+	} from '@/api/views/personalInformation/index.js'
 	export default {
 		data() {
 			return {
@@ -177,7 +181,10 @@
 				// 品牌
 				zsbrandList:[],
 				brandDescfor:7,
-				gengduofalse:true,
+				gengduofalse:true,
+				// 审核状态
+				checkStatus:'',
+				enableOrNot:'',
 			}
 		},
 		onReachBottom() {
@@ -188,8 +195,22 @@
 			} else {
 				this.status = 'nomore'
 			}
+		},
+		onLoad(e) {
+			console.log(e,200);
 		},
-		onShow() {
+		onShow() {
+			if (uni.getStorageSync('cname')) {
+				this.$set(this.search,'cname',JSON.parse(JSON.stringify(uni.getStorageSync('cname'))))
+				uni.removeStorageSync('cname')
+			}
+			// 获取审核状态
+			details().then(res => {
+				this.checkStatus = res.data.checkStatus
+				this.enableOrNot = res.data.enableOrNot
+				uni.setStorageSync('checkStatus', res.data.checkStatus);
+				uni.setStorageSync('enableOrNot', res.data.enableOrNot);
+			})
 			// 轮播图
 			brandDescList({type:'LBT'}).then(res=>{
 				brandDescDetail({id:res.data.records[0].id}).then(res=>{
@@ -391,7 +412,15 @@
 				this.onSearch()
 			},
 			//打开明细
-			choice(item, index) {
+			choice(item, index) {
+				if (this.checkStatus != '通过') {
+					uni.showToast({
+						title: "当前用户未授权,请联系客服",
+						icon: "none",
+						mask:true
+					});
+					return
+				}
 				uni.$u.route('/pages/views/buyGoods/commodityDetails', {
 					id: item.id
 				});

+ 161 - 60
pages/tabBar/shoppingCart.vue

@@ -74,9 +74,11 @@
 		shoppingCartList,
 		generateOrder,
 		shoppingCartUpdate,
-		getCorpsAddr
+		getCorpsAddr,
+		paramserviceDetail
 	} from '@/api/tabBar/shoppingCart.js'
 import { registerRuntimeCompiler } from "vue"
+import { details } from '@/api/views/personalInformation/index.js'
 	export default {
 		data() {
 			return {
@@ -88,7 +90,8 @@ import { registerRuntimeCompiler } from "vue"
 				selectedProduct: [],
 				totalPrice: 0.00,
 				totalFreight: 0.00,
-				addres: {}
+				addres: {},
+				checkStatus:null,
 			}
 		},
 		watch: {
@@ -103,7 +106,25 @@ import { registerRuntimeCompiler } from "vue"
 				this.statistics()
 			}
 		},
-		onShow() {
+		onShow() {
+			// 获取审核状态
+			details().then(res => {
+				this.checkStatus = res.data.checkStatus
+				uni.setStorageSync('checkStatus', res.data.checkStatus);
+				if (this.checkStatus != '通过') {
+					// uni.showToast({
+					// 	title: "当前用户未授权,请联系客服",
+					// 	icon: "none",
+					// 	mask:true
+					// });
+					uni.switchTab({
+						url:'/pages/tabBar/home'
+					})
+					return 
+				}
+			})
+			
+			
 			this.editDel = false
 			this.companyValue = []
 			shoppingCartList().then(res => {
@@ -112,7 +133,29 @@ import { registerRuntimeCompiler } from "vue"
 			})
 			getCorpsAddr().then(res => {
 				this.addres = res.data
-			})
+			})
+			
+			// 支付成功之后的回调
+			let options = wx.getEnterOptionsSync();
+			if (options.scene == '1038' && options.referrerInfo.appId=='wxef277996acc166c3') {
+				// 代表从收银台小程序返回
+				let extraData = options.referrerInfo.extraData;
+				if (!extraData) {
+				// "当前通过物理按键返回,未接收到返参,建议自行查询交易结果";
+				console.log('当前通过物理按键返回,未接收到返参,建议自行查询交易结果');
+				} else {
+					if (extraData.code == 'success') {
+						// "支付成功";
+					} else if (extraData.code == 'cancel') {
+						// "支付已取消";
+						console.log(extraData,'支付已取消');
+					} else {
+						console.log(extraData,'失败');
+						// "支付失败:" + extraData.errmsg;
+					}
+				}
+			}
+			
 		},
 		methods: {
 			clickAddress() {
@@ -187,7 +230,8 @@ import { registerRuntimeCompiler } from "vue"
 				}).catch(err => {
 					uni.hideLoading();
 				})
-			},
+			},
+			// 立即支付
 			submit() {
 				if (this.companyValue.length > 0) {
 					let data = []
@@ -201,7 +245,6 @@ import { registerRuntimeCompiler } from "vue"
 							}
 						}
 					}
-
 					uni.showLoading({
 						title: '加载中',
 						mask: true
@@ -209,60 +252,118 @@ import { registerRuntimeCompiler } from "vue"
 					generateOrder({
 						address: this.addres.belongtoarea + this.addres.detailedAddress,
 						list: data,
-					}).then(res => {	
-						console.log(typeof(res.data.timeStamp));
-						console.log(res);
-						uni.requestPayment({
-								provider: "wxpay", 
-						       appId:res.data.appId,
-						       timeStamp: res.data.timeStamp,
-						       nonceStr: res.data.nonceStr,
-						       package: res.data.package,
-						       signType: res.data.signType,
-						       paySign: res.data.paySign,
-						    success(res) {
-								uni.showToast({
-									title: '支付成功',
-									mask: true,
-									duration: 2000
-								});
-								setTimeout(function() {
-									uni.hideLoading();
-									// this_.refresh(res.data.data.id)
-								}, 1000);
-							},
-						    fail(e) {
-								console.log(e);
-								uni.showToast({
-									title: "支付失败",
-									icon: 'none',
-									mask: true
-								});
-								setTimeout(function() {
-									uni.hideLoading();
-									// this_.refresh(res.data.id)
-								}, 1000);
-							}
-						})	
-			
-						uni.showToast({
-							title: "提交成功",
-							icon: 'none'
-						});
-						uni.hideLoading();
-						uni.showLoading({
-							title: '加载中',
-							mask: true
-						});
-						this.editDel = false
-						this.companyValue = []
-						shoppingCartList().then(res => {
-							this.dataList = res.data
-							this.companyValueLength = this.dataList.length
-							uni.hideLoading();
-						}).catch(err => {
-							uni.hideLoading();
-						})
+					}).then(res => {
+						let generateOrderData = res.data
+						paramserviceDetail({
+							paramKey:'cashier.payment'
+						}).then(res=>{
+							let paramservice = res.data
+							// 判断是调支付台的接口还是微信支付的接口
+							if (paramservice.paramValue == '1') {
+								// uni.hideLoading();
+								let obj = {
+									appId: 'wxef277996acc166c3',
+									extraData: {
+										cusid: generateOrderData.cusid,
+										appid: generateOrderData.appid,
+										orgid: generateOrderData.orgid,
+										version: generateOrderData.version,
+										trxamt: generateOrderData.trxamt,
+										reqsn: generateOrderData.reqsn,
+										notify_url: generateOrderData.notify_url,
+										body: generateOrderData.body,
+										remark: generateOrderData.remark,
+										validtime: generateOrderData.validtime,
+										limit_pay: generateOrderData.limit_pay,
+										randomstr: generateOrderData.randomstr,
+										paytype: generateOrderData.paytype,
+										signtype:generateOrderData.signtype,
+										sign: generateOrderData.sign,
+									},
+								}
+								console.log(obj);
+								wx.openEmbeddedMiniProgram({
+									appId: 'wxef277996acc166c3',
+									extraData: {
+										cusid: generateOrderData.cusid,
+										appid: generateOrderData.appid,
+										orgid: generateOrderData.orgid,
+										version: generateOrderData.version,
+										trxamt: generateOrderData.trxamt,
+										reqsn: generateOrderData.reqsn,
+										notify_url: generateOrderData.notify_url,
+										body: generateOrderData.body,
+										remark: generateOrderData.remark,
+										validtime: generateOrderData.validtime,
+										// limit_pay: generateOrderData.limit_pay,
+										limit_pay:"",
+										randomstr: generateOrderData.randomstr,
+										paytype: generateOrderData.paytype,
+										signtype:generateOrderData.signtype,
+										sign: generateOrderData.sign,
+									},
+									success:(a)=>{
+										uni.hideLoading();
+									},
+									fail:(err)=>{
+										uni.hideLoading();
+									}
+								})
+							}else {
+								uni.requestPayment({
+									provider: "wxpay", 
+								    appId:generateOrderData.appId,
+								    timeStamp: generateOrderData.timeStamp,
+								    nonceStr: generateOrderData.nonceStr,
+								    package: generateOrderData.package,
+								    signType: generateOrderData.signType,
+								    paySign: generateOrderData.paySign,
+								    success(res) {
+										uni.showToast({
+											title: '支付成功',
+											mask: true,
+											duration: 2000
+										});
+										setTimeout(function() {
+											uni.hideLoading();
+											// this_.refresh(res.data.data.id)
+										}, 1000);
+									},
+								    fail(e) {
+										console.log(e);
+										uni.showToast({
+											title: "支付失败",
+											icon: 'none',
+											mask: true
+										});
+										setTimeout(function() {
+											uni.hideLoading();
+											// this_.refresh(res.data.id)
+										}, 1000);
+									}
+								})	
+							}
+						})
+						
+						// uni.showToast({
+						// 	title: "提交成功",
+						// 	icon: 'none'
+						// });
+						// uni.hideLoading();
+						// uni.showLoading({
+						// 	title: '加载中',
+						// 	mask: true
+						// });
+						// this.editDel = false
+						// this.companyValue = []
+						// shoppingCartList().then(res => {
+						// 	this.dataList = res.data
+						// 	this.companyValueLength = this.dataList.length
+						// 	uni.hideLoading();
+						// }).catch(err => {
+						// 	uni.hideLoading();
+						// })
+						
 					}).catch(err => {
 						uni.hideLoading();
 					})

+ 63 - 15
pages/views/buyGoods/commodityDetails.vue

@@ -2,12 +2,13 @@
 	<view style="padding-top: 0.01rpx;">
 		<view style="width: 100%;margin: 0 auto;height: 800rpx;">
 			<!-- <image v-for="(ite,ind) in form.filesList" :key="ind" v-if="ite.version === '0'" :src="ite.url" style="width: 100%;height: 100%;border-radius: 20rpx;"></image> -->
-			<u-swiper :list="form.filesList" indicator indicatorMode="dot" :autoplay="false" height="800rpx"></u-swiper>
+			<u-swiper :list="form.filesList" indicator indicatorMode="dot" 
+			:autoplay="false" height="800rpx" @click="swiperclick"></u-swiper>
 		</view>
 		<view class="contentBox">
 			<view style="display: flex;align-items: center;">
 				<view>
-					<text style="font-size: 58rpx;color: red;margin-right: 20rpx;">¥{{form.mallPrice || 0}}</text>
+					<text style="font-size: 58rpx;color: red;margin-right: 20rpx;">¥{{checkStatus == '通过'?form.mallPrice || 0:'***'}}</text>
 					<!-- <text style="font-size: 48rpx;text-decoration:line-through;">¥{{form.standardPrice}}</text> -->
 				</view>
 				<view style="display: flex;">
@@ -26,16 +27,31 @@
 		<view class="head">
 			<u-cell-group title-bg-color="rgb(243, 244, 246)" :border="false">
 				<u-cell :isLink="false" :border="false" center>
-					<template slot="value">
+					<template slot="title">
 						<u-radio-group
 						    v-model="dataForm.type"
 						    placement="row"
 						    @change="groupChange">
-						    <u-radio activeColor="#FD4B09" v-if="dataForm.thisLocality" :label="`今日达(库存:${~~(dataForm.thisLocality.inventory) || 0})`" :name="0"></u-radio>
-						    <u-radio activeColor="#FD4B09" v-if="dataForm.offsite" :label="`次日达(库存:${~~(dataForm.offsite.inventory) || 0})`" :name="1"></u-radio>
+						    <u-radio activeColor="#FD4B09" v-if="dataForm.thisLocality" 
+							:label="`今日达(库存:${~~(dataForm.thisLocality.inventory) > 10?'充足':~~(dataForm.thisLocality.inventory)})`" :name="0"></u-radio>
+						    <u-radio activeColor="#FD4B09" v-if="dataForm.offsite" 
+							:label="`次日达(库存:${~~(dataForm.offsite.inventory) > 10?'充足':~~(dataForm.offsite.inventory)})`" :name="1"></u-radio>
 						  </u-radio-group>
+					</template>
+					<template slot="value">
+						<view>
+							<u-icon :name="inventoryFalse?'arrow-up':'arrow-down'" @click="inventoryFalsefun()"></u-icon>
+						</view>
 					</template>
-				</u-cell>
+				</u-cell>
+			</u-cell-group>
+			
+			<u-cell-group title-bg-color="rgb(243, 244, 246)" :border="false" v-if="inventoryFalse">
+				<u-cell v-for="(item,index) in inventoryData" :key="index" 
+				:title="item.storageName" :value="Number(item.storeInventory) > 10?'充足':Number(item.storeInventory)"></u-cell>
+			</u-cell-group>
+			
+			<u-cell-group title-bg-color="rgb(243, 244, 246)" :border="false">
 				<!-- <u-cell title="所属公司:" :isLink="true" :border="false" center
 					@click="filterAll(['salesCompanyName','salesCompanyId'])">
 					<template slot="value">
@@ -43,8 +59,9 @@
 					</template>
 				</u-cell> -->
 				<u-cell :isLink="false" :border="false" center>
-					<template slot="title">
-						<text>库存:{{form.inventory?~~(form.inventory):''}}</text>
+					<template slot="title">
+						<!-- 一种利用符号进行的类型转换,转换成数字类型 -->
+						<text>库存:{{form.inventory?~~(form.inventory) > 10?'充足':~~(form.inventory):''}}</text>
 					</template>
 					<template slot="value">
 						<u-number-box v-model="form.goodsNum" :min="1" :max="form.inventory"></u-number-box>
@@ -124,7 +141,8 @@
 	import {
 		appDetail,
 		addToCart,
-		appModifyPrice
+		appModifyPrice,
+		stockDescList
 	} from '@/api/tabBar/home.js'
 	export default {
 		data() {
@@ -142,10 +160,15 @@
 				dataForm:{
 					thisLocality:{},
 					offsite:{}
-				}
+				},
+				inventoryFalse:false,
+				inventoryData:[],
+				// 审核状态
+				checkStatus:'',
 			}
 		},
-		onLoad(onLoad) {
+		onLoad(onLoad) {
+			this.checkStatus = uni.getStorageSync('checkStatus');
 			appDetail(onLoad).then(res => {
 				this.dataForm = res.data
 				if(res.data.type == 0){
@@ -156,7 +179,31 @@
 				this.form.goodsNum = Number(this.form.goodsNum)
 			})
 		},
-		methods: {
+		methods: {
+			// 轮播图点击预览
+			swiperclick(e){
+				let arr = this.form.filesList.map(item=>{
+					return item.url
+				})
+				uni.previewImage({
+					count:arr[e],
+					current:e,
+					urls:arr
+				})
+			},
+			inventoryFalsefun(){
+				this.inventoryFalse = !this.inventoryFalse
+				this.stockDescListfun()
+			},
+			// 库存查询
+			stockDescListfun(){
+				stockDescList({
+					cname:this.form.cname,
+					whether:0
+				}).then(res=>{
+					this.inventoryData = res.data.records
+				})
+			},
 			soldOut() {
 				uni.showToast({
 					icon: "none",
@@ -178,13 +225,14 @@
 				addToCart({
 					...this.form,
 					detailsText: ''
-				}).then(res => {
+				}).then(res => {
+					uni.hideLoading();
 					uni.showToast({
 						title: "加入购物车成功",
 						icon: "none",
-						mask:true
+						mask:true,
+						duration:2500
 					});
-					uni.hideLoading();
 				}).catch(err => {
 					uni.hideLoading();
 				})

+ 50 - 18
pages/views/personalInformation/index.vue

@@ -22,7 +22,7 @@
 							disabledColor="#ffffff"  />
 					</u-form-item>
 					<u-form-item label="省市区" prop="addr" borderBottom @click="selectAddress">
-						<u-input v-model="form.addr" inputAlign="right" border="none" placeholder="请选择省市区"
+						<u-input v-model="form.addr" inputAlign="right" disabled border="none" placeholder="请选择省市区"
 							disabledColor="#ffffff"  />
 					</u-form-item>
 					<u-form-item label="详细地址" prop="details" borderBottom>
@@ -36,7 +36,12 @@
 			<u-button type="primary" shape="circle" color="#FD4B09" text="提交" @click="submit"></u-button>
 		</view>
 		<u-picker :show="showWarehouse" ref="uPicker" :loading="loading" :columns="columns" :keyName="keyName"
-			@confirm="confirmWarehouse" @change="changeHandler" @cancel="showWarehouse = false"></u-picker>
+			@confirm="confirmWarehouse" @change="changeHandler" @cancel="showWarehouse = false"></u-picker>
+			
+		<u-modal :show="modalShow" content="客户名称已存在是否继续" showCancelButton 
+			@confirm="modalconfirm" @cancel="modalcancel"
+			ref="uModal" :asyncClose="true">
+		</u-modal>
 	</view>
 </template>
 
@@ -44,7 +49,8 @@
 	import {
 		submit,
 		details,
-		selectList
+		selectList,
+		corpsDescWhetherExistence
 	} from '@/api/views/personalInformation/index.js'
 	export default {
 		data() {
@@ -53,7 +59,8 @@
 				loading: false,
 				columns: [],
 				keyName: 'name',
-				form: {}
+				form: {},
+				modalShow:false,
 			}
 		},
 		onLoad(onLoad) {
@@ -99,7 +106,8 @@
 						this.loading = false
 					})
 				}
-			},
+			},
+			// 提交
 			submit() {
 				if (!this.form.cname) return uni.showToast({
 					icon: "none",
@@ -129,19 +137,43 @@
 				uni.showLoading({
 					title: '加载中',
 					mask: true
-				});
-				submit(this.form).then(res => {
-					uni.showToast({
-						icon: "none",
-						title: '提交成功',
-						mask: true
-					});
-					setTimeout(() => {
-						uni.hideLoading();
-						uni.navigateBack();
-					}, 500);
-				})
-			}
+				});
+				if (!this.form.id) {
+					this.form.checkStatus = '提交'
+					corpsDescWhetherExistence({cname:this.form.cname}).then(res=>{
+						console.log(res.data,138);
+						if (res.data > 0) {
+							this.modalShow = true
+						}else {
+							this.submitfun()
+						}
+					})
+				}else {
+					this.submitfun()
+				}				
+			},
+			// 弹窗的确认
+			modalconfirm(){
+				this.submitfun()
+			},
+			// 弹窗关闭
+			modalcancel(){
+				this.modalShow = false
+			},
+			// 提交接口
+			submitfun(){
+				submit(this.form).then(res => {
+					uni.showToast({
+						icon: "none",
+						title: '提交成功',
+						mask: true
+					});
+					setTimeout(() => {
+						uni.hideLoading();
+						uni.navigateBack();
+					}, 500);
+				})
+			},
 		}
 	}
 </script>

+ 91 - 53
pages/views/salesSlip/obligation.vue

@@ -22,13 +22,13 @@
 				<view style="margin-left: 20rpx;display: flex;align-items: center;" v-for="(ite,ind) in item.list"
 					:key="ind">
 					<view>
-						<image v-for="(li,inde) in ite.orderItemsList" :key="inde"  :src="li.url"
+						<image v-for="(li,inde) in ite.orderItemsList" :key="inde"  :src="li.goodsFilesList[0].url"
 							style="width: 200rpx;height: 200rpx;border-radius: 20rpx;">
 						</image>
 					</view>
 					<view class="goods" >
-						<u--text v-for="(ites,inds) in ite.orderItemsList" :text="ites.goodsName" size="24rpx" lines="2"></u--text>
-						<view class="price" v-for="(ites,inds) in ite.orderItemsList">
+						<u--text v-for="(ites,inds) in ite.orderItemsList" :key="inds" :text="ites.goodsName" size="24rpx" lines="2"></u--text>
+						<view class="price" v-for="(ites,inds) in ite.orderItemsList" :key="inds">
 							<view>¥{{ites.price}}</view>
 							<view v-if="!editDel">
 								<u-number-box v-model="ites.goodsNum" :min="1" :max="ites.goodsNum" buttonSize="40rpx"
@@ -70,7 +70,8 @@
 		payPrepay,
 		shoppingCartUpdate,
 		getCorpsAddr,
-		update
+		update,
+		paramserviceDetail
 	} from '@/api/tabBar/shoppingCart.js'
 import { registerRuntimeCompiler } from "vue"
 import { logo } from '../../../common/setting'
@@ -213,59 +214,96 @@ import { logo } from '../../../common/setting'
 						title: '加载中',
 						mask: true
 					});
+					
 					payPrepay({srcOrderNo:data[0].name}).then(res => {
-						console.log(res);
-						uni.requestPayment({
-								provider: "wxpay",
-						       appId:res.data.appId,
-						       timeStamp: res.data.timeStamp,
-						       nonceStr: res.data.nonceStr,
-						       package: res.data.package,
-						       signType: res.data.signType,
-						       paySign: res.data.paySign,
-						    success(res) {
-								uni.showToast({
-									title: '支付成功',
-									mask: true,
-									duration: 2000
-								});
-								setTimeout(function() {
-									uni.hideLoading();
-									// this_.refresh(res.data.data.id)
-								}, 1000);
-							},
-						    fail(e) {
-								console.log(e);
-								uni.showToast({
-									title: "支付失败",
-									icon: 'none',
-									mask: true
-								});
-								setTimeout(function() {
-									uni.hideLoading();
-									// this_.refresh(res.data.id)
-								}, 1000);
+						let generateOrderData = res.data
+						paramserviceDetail({
+							paramKey:'cashier.payment'
+						}).then(res=>{
+							let paramservice = res.data
+							// 判断是调支付台的接口还是微信支付的接口
+							if (paramservice.paramValue == '1') {
+								wx.openEmbeddedMiniProgram({
+									appId: 'wxef277996acc166c3',
+									extraData: {
+										cusid: generateOrderData.cusid,
+										appid: generateOrderData.appid,
+										orgid: generateOrderData.orgid,
+										version: generateOrderData.version,
+										trxamt: generateOrderData.trxamt,
+										reqsn: generateOrderData.reqsn,
+										notify_url: generateOrderData.notify_url,
+										body: generateOrderData.body,
+										remark: generateOrderData.remark,
+										validtime: generateOrderData.validtime,
+										limit_pay: generateOrderData.limit_pay,
+										randomstr: generateOrderData.randomstr,
+										paytype: generateOrderData.paytype,
+										signtype:generateOrderData.signtype,
+										sign: generateOrderData.sign,
+									},
+									success:(a)=>{
+										uni.hideLoading();
+									},
+									fail:(err)=>{
+										uni.hideLoading();
+									}
+								})
+							}else {
+								uni.requestPayment({
+										provider: "wxpay",
+								       appId:generateOrderData.appId,
+								       timeStamp: generateOrderData.timeStamp,
+								       nonceStr: generateOrderData.nonceStr,
+								       package: generateOrderData.package,
+								       signType: generateOrderData.signType,
+								       paySign: generateOrderData.paySign,
+								    success(res) {
+										uni.showToast({
+											title: '支付成功',
+											mask: true,
+											duration: 2000
+										});
+										setTimeout(function() {
+											uni.hideLoading();
+											// this_.refresh(res.data.data.id)
+										}, 1000);
+									},
+								    fail(e) {
+										console.log(e);
+										uni.showToast({
+											title: "支付失败",
+											icon: 'none',
+											mask: true
+										});
+										setTimeout(function() {
+											uni.hideLoading();
+											// this_.refresh(res.data.id)
+										}, 1000);
+									}
+								})
 							}
 						})
+						
 
-						uni.showToast({
-							title: "提交成功",
-							icon: 'none'
-						});
-						uni.hideLoading();
-						uni.showLoading({
-							title: '加载中',
-							mask: true
-						});
-						this.editDel = false
-						this.companyValue = []
-						shoppingCartList().then(res => {
-							this.dataList = res.data
-							this.companyValueLength = this.dataList.length
-							uni.hideLoading();
-						}).catch(err => {
-							uni.hideLoading();
-						})
+						// uni.showToast({
+						// 	title: "提交成功",
+						// 	icon: 'none'
+						// });
+						// uni.hideLoading();
+						// uni.showLoading({
+						// 	title: '加载中',
+						// 	mask: true
+						// });
+						// this.editDel = false
+						// this.companyValue = []
+						// shoppingCartList().then(res => {
+						// 	this.dataList = res.data
+						// 	this.companyValueLength = this.dataList.length
+						// 	uni.hideLoading();
+						// }).catch(err => {
+						// 	uni.hideLoading();
+						// })
 					}).catch(err => {
 						uni.hideLoading();
 					})

+ 10 - 7
pages/views/salesSlip/orderDetails.vue

@@ -62,7 +62,7 @@
 					<u-row>
 						<u-col span="2.9">
 							<u--image :showLoading="true"
-								:src="item.url?item.url:'https://td.echepei.com/file/applets/resources/parts/images/404.png'"
+								:src="item.goodsFilesList.length > 0?item.goodsFilesList[0].url:'https://td.echepei.com/file/applets/resources/parts/images/404.png'"
 								width="150rpx" height="150rpx" radius="10">
 							</u--image>
 						</u-col>
@@ -105,12 +105,14 @@
 		<view v-if="isDisabled"
 			style="width: 100%;position: fixed;bottom: 0;background-color: #fff;border-top: 1rpx solid #ccc;padding-bottom: env(safe-area-inset-bottom);z-index: 10;">
 			<view style="width: 100%;display: flex;font-size: 24rpx;height: 80rpx;">
-				<view @click="requestRefund" v-if="form.status == '已发货'"
+				<view @click="requestRefund" 
+				v-if="roleaName == '客户'?form.status == '已发货':false"
 					style="width: 50%;display: grid;background-color: #b3b3b3;justify-items: center;height: 100%;align-items: center;">
 					<!-- <u-icon name="close" color="#fff"></u-icon> -->
 					<view style="color: #fff;">申请退款</view>
 				</view>
-				<view @click="orderClosing" v-if="form.status != '录入' && form.status != '已取消'"
+				<view @click="orderClosing" 
+				v-if="roleaName == '客户'?form.status != '录入' && form.status != '已取消' && form.actualPaymentStatus == 2:false"
 					style="width: 100%;background-color: #FD4B09;display: grid;justify-items: center;height: 100%;align-items: center;">
 					<!-- <u-icon name="close" color="#fff"></u-icon> -->
 					<view style="color: #fff;">{{order}}</view>
@@ -158,10 +160,13 @@
 				isDisabled: true,
 				form: {
 					orderItemsList: []
-				}
+				},
+				roleaName:'', // 用户权限
 			}
 		},
-		onLoad(onLoad) {
+		onLoad(onLoad) {
+			// 获取当前登录人的用户信息
+			this.roleaName = uni.getStorageSync('lifeData').userInfo.role_name
 			uni.showLoading({
 				title: '加载中',
 				mask: true
@@ -170,9 +175,7 @@
 			appDetail({
 				id: onLoad.id
 			}).then(res => {
-				console.log(234324324);
 				this.form = res.data
-				console.log(this.form);
 				this.form.orderItemsList.map(item=>{
 					item.totalAmount = item.price * item.goodsNum
 				})

+ 12 - 3
pages/views/vehicle/autoParts.vue

@@ -18,11 +18,11 @@
 						</u-cell>
 					</u-cell-group>
 					<view style="padding: 0 25rpx;">
-						<u-form-item label="前轮胎" prop="cname" borderBottom>
+						<u-form-item label="前轮胎" prop="cname" borderBottom @click="SearchJump(form.frontTireSpecification)">
 							<u-input v-model="form.frontTireSpecification" inputAlign="right" border="none"
 								disabledColor="#ffffff" disabled/>
 						</u-form-item>
-						<u-form-item label="后轮胎" prop="attn" borderBottom>
+						<u-form-item label="后轮胎" prop="attn" borderBottom @click="SearchJump(form.rearTireSpecification)" >
 							<u-input v-model="form.rearTireSpecification" inputAlign="right" border="none"
 								disabledColor="#ffffff" disabled/>
 						</u-form-item>
@@ -35,7 +35,7 @@
 
 <script>
 	import {
-		detail
+		detail,goodsdescGetCnameInt
 	} from '@/api/views/vehicle/brand.js'
 	export default {
 		data() {
@@ -55,6 +55,15 @@
 			})
 		},
 		methods: {
+			// 搜索跳转
+			SearchJump(cname) {
+				goodsdescGetCnameInt({cname}).then(res=>{
+					uni.setStorageSync('cname', res.data);
+					uni.switchTab({
+						url: '/pages/tabBar/home',
+					})
+				})
+			},
 			reLaunch(){
 				uni.switchTab({
 					url: '/pages/tabBar/home'