Browse Source

Merge branch 'main' of https://gitlab.com/tea28/client

hejie 3 years ago
parent
commit
14053fcaa5

+ 3 - 3
package-lock.json

@@ -15428,9 +15428,9 @@
           "optional": true
         },
         "loader-utils": {
-          "version": "2.0.3",
-          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz",
-          "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==",
+          "version": "2.0.4",
+          "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz",
+          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
           "dev": true,
           "optional": true,
           "requires": {

+ 3 - 3
src/app.scss

@@ -28,9 +28,9 @@ view, text, div {word-break: break-all;color:#333;font-family: "SourceHanSansSC-
 /* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
 @font-face {
     font-family: 'iconfont';  /* Project id 3748689 */
-    src: url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.woff2?t=1668151644072') format('woff2'),
-         url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.woff?t=1668151644072') format('woff'),
-         url('//at.alicdn.com/t/c/font_3748689_9lwy7tb2de.ttf?t=1668151644072') format('truetype');
+    src: url('//at.alicdn.com/t/c/font_3748689_7xs9pnbmm8.woff2?t=1668320176353') format('woff2'),
+         url('//at.alicdn.com/t/c/font_3748689_7xs9pnbmm8.woff?t=1668320176353') format('woff'),
+         url('//at.alicdn.com/t/c/font_3748689_7xs9pnbmm8.ttf?t=1668320176353') format('truetype');
   }
 .iconfont {
     font-family: "iconfont" !important;

+ 4 - 10
src/components/authorize-module/index.vue

@@ -27,7 +27,8 @@
 				
 				<view class="btnBar flex_r flex_ac flex_jb">
 					<button class='no-authorize_btn unSetBtn' @tap="onSoHAuth">{{isGetTel ? "暂不授权" : "暂不登录"}}</button>
-					<button open-type="getUserInfo" class='no-authorize_btn' @tap="onGotUserInfo" lang="zh_CN">立即登录</button>
+					<button open-type="getPhoneNumber" class='no-authorize_btn' @getphonenumber="onGotPhoneNumber" lang="zh_CN">立即登录</button>
+					<!-- <button open-type="getUserInfo" class='no-authorize_btn' @tap="onGotUserInfo" lang="zh_CN">立即登录</button> -->
 				</view>
 			</view>
 		</view>
@@ -75,19 +76,12 @@
 			    this.$emit('authSuccess');
 			},
 			onGotPhoneNumber(e){
-			    if (!e.detail.iv || !e.detail.encryptedData) {
-			        return;
-			    } else {
-			        this.$emit('authGetTelSuccess', {
-			            iv: e.detail.iv,
-			            encryptedData: e.detail.encryptedData
-			        });
-			    }
+                this.$emit('authGetTelSuccess', e);
 			},
 			checkboxChange(e) {
 			    var value = e.detail.value;
 			    this.isDisabled = value.length == 0
-			}
+			},
 		}
 	}
 </script>

+ 4 - 4
src/components/goodsList.vue

@@ -2,15 +2,15 @@
     <view class="product-list">
         <view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id,i.type)">
             <view class="image-view">
-                <image class="product-image" :src="i.goodsThumbnailUrl"></image>
+                <image class="product-image" :src="i.original_img"></image>
             </view>
-            <view :class="['product-title', 'ellipsis' + long]">{{ i.goods.goods_name }}</view>
+            <view :class="['product-title', 'ellipsis' + long]">{{ i.goods_name }}</view>
             <view class="product-price">
-                <text class="product-price-original"><text class="product-unit">¥</text>{{ type == 2 ? i.trade_price : i.cost_price }}</text>
+                <text class="product-price-original"><text class="product-unit">¥</text>{{ i.price }}</text>
                 <!-- <text class="product-price-favour">¥{{i.originalPrice}}</text> -->
                 <!-- <text class="product-tip">{{i.tip}}</text> -->
             </view>
-            <view class="product-txt">{{ i.trade_give_num }}</view>
+            <view class="product-txt">{{ type == 3 ? i.give_cha_bao + "茶宝" : i.give_integral + "积分" }}</view>
         </view>
         <view class='fz_w_text mar_t20 mar_b20'>茶,让生活更美好!</view>
     </view>

+ 4 - 1
src/manifest.json

@@ -68,7 +68,10 @@
         "permission" : {}
     },
     "mp-alipay" : {
-        "usingComponents" : true
+        "usingComponents" : true,
+        "uniStatistics" : {
+            "enable" : false
+        }
     },
     "mp-baidu" : {
         "usingComponents" : true

+ 18 - 3
src/pages.json

@@ -155,14 +155,29 @@
 			"style": {
 				"navigationBarTitleText": "充值"
 			}
+		},
+				{
+		    "path" : "pages/aytonym-status/index",
+		    "style" : {
+				"navigationBarTitleText": "实名认证"
+			}
 		},
 		{
-			"path": "pages/autoym-submit/index",
-			"style": {
+		    "path" : "pages/autonym-submit/index",
+		    "style" : {
 				"navigationBarTitleText": "实名认证"
 			}
 		}
-	],
+	    ,{
+            "path" : "pages/autonym-pay/index",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"tabBar": {
 		"color": "#505050",
 		"selectedColor": "#12B280",

+ 219 - 0
src/pages/autonym-pay/index.vue

@@ -0,0 +1,219 @@
+<template>
+	<view class="container">
+		<!-- 实名费用 -->
+		<view class="auto_cost flex_r flex_ac flex_jb mar_t20">
+			<view class="auto_name">实名费用</view>
+			<view class="price"><text>¥</text>{{price}}</view>
+		</view>
+		<!-- 实名费用-end -->
+
+		<!-- 微信支付 -->
+		<view class="option flex_c mar_t20">
+			<view class="list_name">充值方式</view>
+			<view class="option_con flex_r flex_ac flex_jb mar_t16" @tap="setPayWay">
+				<view class="way_con flex_r flex_ac">
+					<image class="way_img" src="/static/weixin_icon.png" mode=""></image>
+					<view class="way_text">微信支付</view>
+				</view>
+				<view class="way_radio" :class="isSelect ? 'select' : ''"></view>
+			</view>
+		</view>
+		<!-- 微信支付-end -->
+
+		<!-- 按钮 -->
+		<view class="btn flex_r flex_ac flex_jc" @tap="autoOrderPay">下一步</view>
+		<!-- 按钮-end -->
+	</view>
+</template>
+
+<script>
+	let page = 1;
+	let app = getApp();
+	var appEv = app.$vm.$options;
+	import {
+		ToPayOpre
+	} from "@/utils/reqTools.js";
+	let toPayOpre = new ToPayOpre();
+	import {
+		post
+	} from "@/request/api.js";
+	export default {
+		data() {
+			return {
+				price: '',
+				isSelect: false,
+				payDetail:undefined,
+				
+			};
+		},
+		onLoad: function(e) {
+			// this.loadData()
+			console.log(e.payDetail,"aaaaaaaaaaaa")
+			this.payDetail = JSON.parse(decodeURIComponent(e.payDetail));
+			// console.log(this.payDetail,"支付信息" )
+			this.price = e.amount
+		},
+		methods: {
+			autoOrderPay() {
+				if (!this.isSelect) {
+					appEv.errTips('请选择支付方式')
+					return false
+				}
+				// // #ifdef  H5
+				// let type = "H5";
+				// // #endif
+				// // #ifdef  APP
+				// let type = "app";
+				// // #endif
+				// // #ifdef  MP-WEIXIN
+				// let type = "jsapi";
+				// // #endif
+				// let data = {
+				// 	trade_type: type
+				// };
+				toPayOpre.toPay(this.payDetail, (rea) => {
+					if (!rea) {
+						// 支付成功
+						appEv.errTips('实名认证中,请稍等')
+						uni.switchTab({
+						  url: "/pages/my/index",
+						});
+				
+					} else {
+						// 支付失败
+						appEv.errTips('支付已取消')
+					}
+				});
+				// let that = this;
+				// let data = {
+				// 	price:this.price * 100
+				// }
+				// return
+				// const info = reqApi.identifyPayment(data)
+				// if(info){
+				// 	info.then(res => {
+				// 		if(res.data.status == 200){
+				// 			toPayOpre.toPay(res.data.payParam, (rea) => {
+				// 				if (!rea) {
+				// 					// 支付成功
+				// 					uni.redirectTo({
+				// 						url: '/pages/autonym-submit/index'
+				// 					})
+				// 				} else {
+				// 					// 支付失败
+				// 					appEv.errTips('支付已取消')
+				// 				}
+				// 			});
+				// 		}
+				// 	})
+				// }
+			},
+			setPayWay: function() {
+				this.isSelect = !this.isSelect
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	// 页面配置
+	page {
+		background: #F4F4F4;
+	}
+
+	// 页面配置-end
+
+	// 实名费用
+	.price {
+		font-size: 36rpx;
+		color: #E75B25;
+		font-family: "SourceHanSansCN-Medium";
+	}
+
+	.auto_name {
+		font-size: 28rpx;
+		color: #121212;
+		font-family: "SourceHanSansCN-Medium";
+	}
+
+	.price text {
+		font-size: 24rpx;
+		color: #E75B25;
+		font-family: "SourceHanSansCN-Medium";
+	}
+
+	.auto_cost {
+		width: 100%;
+		height: 104rpx;
+		background: #fff;
+		padding: 0 30rpx;
+		box-sizing: border-box;
+	}
+
+	// 实名费用-end
+
+	// 微信支付
+	.option_con {
+		width: 100%;
+		overflow: hidden;
+	}
+
+	.way_img {
+		width: 52rpx;
+		height: 52rpx;
+		margin-right: 8rpx;
+	}
+
+	.way_text {
+		font-size: 22rpx;
+		color: #333333;
+		font-family: "SourceHanSansCN-Medium";
+	}
+
+	.list_name {
+		color: #333333;
+		font-size: 28rpx;
+		font-family: "SourceHanSansCN-Medium";
+		font-weight: 500;
+	}
+
+	.option {
+		width: 100%;
+		overflow: hidden;
+		padding: 20rpx 30rpx 60rpx;
+		box-sizing: border-box;
+		background: #fff;
+	}
+
+	.way_radio {
+		width: 39rpx;
+		height: 35rpx;
+		background: url("~@/static/weixuanzhong.png");
+		background-repeat: no-repeat;
+		background-size: 35rpx 35rpx;
+		background-position: center center;
+	}
+
+	.select {
+		background: url("~@/static/consent.png");
+		background-repeat: no-repeat;
+		background-size: 39rpx 35rpx;
+		background-position: center center;
+	}
+
+	// 微信支付-end
+
+	// 按钮
+	.btn {
+		width: 689rpx;
+		height: 92rpx;
+		background: #17BB87;
+		border-radius: 10rpx;
+		font-family: "SourceHanSansCN-Medium";
+		font-size: 42rpx;
+		color: #fff;
+		margin: 167rpx auto;
+	}
+
+	// 按钮-end
+</style>

+ 143 - 0
src/pages/autonym-submit/index.vue

@@ -0,0 +1,143 @@
+<template>
+	<view class="container">
+		<!-- 提示信息 -->
+		<view class="hint flex_r flex_ac">请填写本人真实信息</view>
+		<!-- 提示信息-end -->
+
+		<!-- 提交内容 -->
+		<view class="con">
+			<view class="list flex_r flex_ac">
+				<view class="list_name">真实姓名:</view>
+				<input class="list_input flex_grow" type="text" v-model="name" placeholder="请输入您的真实姓名" />
+			</view>
+			<view class="list flex_r flex_ac">
+				<view class="list_name">身份证号:</view>
+				<input class="list_input flex_grow" type="text" v-model="code" placeholder="请输入您的身份证号" />
+			</view>
+			<view class="btn flex_r flex_ac flex_jc" @tap="submit">提交审核</view>
+		</view>
+		<!-- 提交内容-end -->
+	</view>
+</template>
+
+<script>
+	let page = 1;
+	let app = getApp();
+	// let reqApi = new ReqApi();
+	var appEv = app.$vm.$options;
+	// import { ReqApi } from "@/utils/reqTools.js";
+	import {
+		post
+	} from "@/request/api.js";
+	import {
+		ToPayOpre
+	} from "@/utils/reqTools.js";
+	let toPayOpre = new ToPayOpre();
+	export default {
+		data() {
+			return {
+				name: "",
+				code: ""
+			};
+		},
+		onLoad() {
+			this.loadData()
+		},
+		methods: {
+			submit() {
+				// #ifdef  H5
+				let type = "H5";
+				// #endif
+				// #ifdef  APP
+				let type = "app";
+				// #endif
+				// #ifdef  MP-WEIXIN
+				let type = "jsapi";
+				// #endif
+				let data = {
+					name: this.name,
+					card: this.code,
+					trade_type: type,
+					amount:this.amount
+				};
+				post("/user/authentication", data).then(res => {
+					if (res.code === 0) {
+						uni.redirectTo({
+							url: "/pages/autonym-pay/index?amount=" + this.amount + '&payDetail=' + encodeURIComponent(JSON.stringify(res.data.data)),
+						});
+
+					} else {
+						appEv.errTips(res.msg)
+					}
+
+				});
+			},
+			loadData(){
+				post('/user/isPayAuth').then(res => {
+					if(res.code === 0){
+						this.amount = res.data.amount
+					}
+				})
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	// 页面配置
+	// 页面配置-end
+
+	// 提示信息
+	.hint {
+		width: 100%;
+		height: 74rpx;
+		font-size: 24rpx;
+		color: #e75b25;
+		padding: 0 30rpx;
+		background: #f4f4f4;
+	}
+
+	// 提示信息-end
+
+	// 提交内容
+	.con {
+		width: 1005;
+		overflow: hidden;
+		padding: 30rpx;
+		box-sizing: border-box;
+	}
+
+	.list {
+		width: 100%;
+		height: 100rpx;
+		border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+	}
+
+	.list_name {
+		font-size: 28rpx;
+		color: #333333;
+		font-weight: "SourceHanSansCN-Medium";
+		width: 130rpx;
+	}
+
+	.list_input {
+		width: calc(100% - 140rpx);
+		margin-left: 10rpx;
+		height: 100%;
+		font-size: 28rpx;
+		color: #333;
+	}
+
+	.btn {
+		width: 395rpx;
+		height: 95rpx;
+		border-radius: 10rpx;
+		background: #17bb87;
+		color: #fff;
+		font-size: 34rpx;
+		font-family: "SourceHanSansCN-Medium";
+		margin: 100rpx auto 0;
+	}
+
+	// 提交内容-end
+</style>

+ 0 - 131
src/pages/autoym-submit/index.vue

@@ -1,131 +0,0 @@
-<template>
-  <view class="container">
-    <!-- 提示信息 -->
-    <view class="hint flex_r flex_ac">请填写本人真实信息</view>
-    <!-- 提示信息-end -->
-
-    <!-- 提交内容 -->
-    <view class="con">
-      <view class="list flex_r flex_ac">
-        <view class="list_name">真实姓名:</view>
-        <input
-          class="list_input flex_grow"
-          type="text"
-          v-model="name"
-          placeholder="请输入您的真实姓名"
-        />
-      </view>
-      <view class="list flex_r flex_ac">
-        <view class="list_name">身份证号:</view>
-        <input
-          class="list_input flex_grow"
-          type="text"
-          v-model="code"
-          placeholder="请输入您的身份证号"
-        />
-      </view>
-      <view class="btn flex_r flex_ac flex_jc" @tap="submit">提交审核</view>
-    </view>
-    <!-- 提交内容-end -->
-  </view>
-</template>
-
-<script>
-let page = 1;
-let app = getApp();
-// let reqApi = new ReqApi();
-var appEv = app.$vm.$options;
-// import { ReqApi } from "@/utils/reqTools.js";
-import { post } from "@/request/api.js";
-export default {
-  data() {
-    return {
-      name: "",
-      code: "",
-    };
-  },
-  onLoad: function () {},
-  methods: {
-    submit: function () {
-      let data = {
-        name: this.name,
-        card: this.code,
-      };
-      post("/user/authentication", data).then((res) => {
-      });
-      //   let that = this;
-      //   let data = {
-      //     name: this.name,
-      //     idNumber: this.code,
-      //   };
-      //   const info = reqApi.identifyTwo(data);
-      //   if (info) {
-      //     info.then((res) => {
-      //       if (res.data.status == 200) {
-      //         uni.redirectTo({
-      //           url: "/pages/aytonym-status/index?status=1",
-      //         });
-      //       } else {
-      //         uni.redirectTo({
-      //           url: "/pages/aytonym-status/index?status=0&msg=" + res.data.msg,
-      //         });
-      //       }
-      //     });
-      //   }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-// 页面配置
-// 页面配置-end
-
-// 提示信息
-.hint {
-  width: 100%;
-  height: 74rpx;
-  font-size: 24rpx;
-  color: #e75b25;
-  padding: 0 30rpx;
-  background: #f4f4f4;
-}
-// 提示信息-end
-
-// 提交内容
-.con {
-  width: 1005;
-  overflow: hidden;
-  padding: 30rpx;
-  box-sizing: border-box;
-}
-.list {
-  width: 100%;
-  height: 100rpx;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
-}
-.list_name {
-  font-size: 28rpx;
-  color: #333333;
-  font-weight: "SourceHanSansCN-Medium";
-  width: 130rpx;
-}
-.list_input {
-  width: calc(100% - 140rpx);
-  margin-left: 10rpx;
-  height: 100%;
-  font-size: 28rpx;
-  color: #333;
-}
-.btn {
-  width: 395rpx;
-  height: 95rpx;
-  border-radius: 10rpx;
-  background: #17bb87;
-  color: #fff;
-  font-size: 34rpx;
-  font-family: "SourceHanSansCN-Medium";
-  margin: 100rpx auto 0;
-}
-// 提交内容-end
-</style>

+ 61 - 0
src/pages/aytonym-status/index.vue

@@ -0,0 +1,61 @@
+<template>
+	<view class="container">
+		<image class="status_img" :src="isPass == 1 ? 'https://tea.soowin.com/mnt/image/success.png' : '/static/error.png'" mode=""></image>
+		<view class="hint flex_r flex_jc" v-if="isPass == 0">失败原因:{{msg}}</view>
+		<view class="status_con flex_r flex_ac flex_jc">
+			<block v-if="isPass == 1">
+				<view class="confim_btn flex_r flex_ac flex_jc" @tap="returnPage">认证通过</view>
+			</block>
+			<block v-else>
+				<view class="return flex_r flex_ac flex_jc" @tap="returnPage">返回</view>
+				<view class="err_btn flex_r flex_ac flex_jc" @tap="reapply">重新申请</view>
+			</block>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				isPass:0 ,// 0:失败;1:成功
+				msg:'' // 失败原因
+			};
+		},
+		onLoad:function(e){
+			this.isPass = e.status
+			if(e.msg){
+				this.msg = e.msg
+			}
+		},
+		methods:{
+			reapply(){
+				uni.redirectTo({
+					url:'/pages/autonym-submit/index'
+				})
+			},
+			returnPage:function(){
+				uni.navigateBack({
+					delta:1
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+// 页面配置
+.container{border-top: 16rpx solid #f4f4f4;}
+// 页面配置-end
+
+.status_con{width: 100%;overflow: hidden;margin-top:61rpx;}
+.hint{width: 100%;overflow: hidden;font-size: 30rpx;color:#5A5A5A}
+.status_img{width: 366rpx;height: 249rpx;margin: 127rpx auto 0;display: block;}
+.confim_btn{width: 317rpx;height: 74rpx;background: #17BB87;color:#fff;font-size: 36rpx;border-radius: 37rpx;margin:0 auto;}
+
+// 审核失败按钮
+.return,.err_btn{width: 241rpx;height: 74rpx;border-radius: 37rpx;font-size: 36rpx;color:#fff;margin-right: 133rpx;}
+.err_btn{margin-right: 0;background: #1FBF8D;}
+.return{background: #E75B25;}
+// 审核失败按钮-end
+</style>

+ 1 - 1
src/pages/index/index.vue

@@ -48,7 +48,7 @@
         </view>
         <view class="list_bar">
             <div class="tit">猜你喜欢</div>
-            <goodslist :long="1" type="1" />
+            <goodslist :long="1" type="3" />
         </view>
     </div>
 </template>

+ 44 - 21
src/pages/my/index.vue

@@ -379,10 +379,10 @@
     <authorize-module
       v-if="showAuth"
       :shopInfo="shopInfo"
-      @authSuccess="onAuthSuccess"
-      @onGotUserInfo="onGotUserInfo"
+      @authGetTelSuccess="onauthGetTelSuccess"
     ></authorize-module>
     <!-- 授权-end -->
+    <newauthorize ref="newauthorize"/>
   </view>
 </template>
 
@@ -393,11 +393,13 @@ var appEv = app.$vm.$options;
 // let reqApi = new ReqApi();
 // import { ReqApi } from "@/utils/reqTools.js";
 import authorizeModule from "@/components/authorize-module/index";
+// import newauthorize from "@/components/authorize-module/new";
 import uniCopy from "../../utils/copy";
 import { get, post, u_post } from "@/request/api.js";
 export default {
   components: {
     authorizeModule,
+    // newauthorize
   },
   data() {
     return {
@@ -409,6 +411,8 @@ export default {
       agentName: "", // 缘起
       user_id: undefined,
       userinfo: undefined, // 获取用户信息
+
+      unid: '',
     };
   },
   onLoad: function (options) {
@@ -435,12 +439,24 @@ export default {
   },
   methods: {
     login() {
+      let that = this
       // #ifdef  MP-WEIXIN
       wx.login({
         success(res) {
           if (res.code) {
-            post("appletLogin", { code: res.code }).then((res) => {
-              console.log(res);
+            post("appletLogin", { code: res.code }).then(res => {
+              if(res.code === 0){
+                if(res.data.token){
+                  uni.setStorageSync('token', res.data.token);
+                  that.getuserInfo();
+                }else{
+                  that.unid = res.data.unid
+                  // setTimeout(() => {
+                    that.showAuth = true
+                    that.shopInfo = app.globalData.shopInfo
+                  // }, 500);
+                }
+              }
             });
           }
         },
@@ -451,36 +467,43 @@ export default {
       this.goto("/pages/my/login");
       // #endif
     },
-
-    // 获取用户信息
-    loadData() {
-      post("ShuZiTeaYW/my/index", {
-        userId: this.user_id,
-      }).then((res) => {
-        if (res.status == 200) {
-          this.userInfo = res.userInfo;
-          this.userInfoAccount = res.userInfoAccount;
-          this.customerServiceWeiXin = res.customerServiceWeiXin;
-          this.isShiMing = res.userInfo.identifyFlag == 0 ? false : true;
-          // this.BannerImg = res.list;
-        }
-      });
+    onauthGetTelSuccess(da){
+      this.showAuth = false;
+      post("getMobile", {unid:this.unid, ...da.detail}).then(res => {
+            if (res.code === 0) {
+                uni.setStorageSync('token', res.data.token);
+                this.getuserInfo();
+            }
+      })
     },
+    getuserInfo() {
+        post("/user/userinfo").then((res) => {
+            if (res.code === 0) {
+                uni.setStorageSync('userinfo', res.data.data);
+                this.userinfo = res.data.data
+            }
+        });
+    },
+
     //授权并登录
     onAuthSuccess: function () {
       var that = this;
       uni.showLoading({ mask: true });
       appEv.setData((res) => {
-        // that.loadData();
         uni.hideLoading();
         that.showAuth = false;
       });
     },
     // 跳转到实名页面
     goToAutonym() {
-      console.log("qqqqqqqqq");
+		// post('/user/isPayAuth').then(res => {
+		// 	if(res.code === 0){
+		// 		if(res.data.)
+		// 	}
+		// })
+		// return
       uni.navigateTo({
-        url: "/pages/autoym-submit/index",
+        url: "/pages/autonym-submit/index",
       });
     },
     // 关闭实名信息

+ 2 - 2
src/pages/my/login.vue

@@ -7,7 +7,7 @@
         <view class="phoneL" v-if="LoginType == 1">
             <view class="clearfix"><input v-model="formD2.mobile" placeholder="请输入手机号" type="number" maxlength="11" /></view>
             <view class="clearfix">
-                <input v-model="formD2.captcha" placeholder="请输入验证码" confirm-type="go" type="number" maxlength="6" class="w70" />
+                <input v-model="formD2.captcha" placeholder="请输入验证码" confirm-type="go" type="number" maxlength="5" class="w70" />
                 <view @click="getVerifyCode" :class="{w30:true,corb:msgNum!=='获取验证码'}">{{msgNum}}</view>
             </view>
             <view v-if="signIn" class="clearfix">
@@ -138,7 +138,7 @@ export default {
             if (this.LoginType == 1) {
                 let m = this.formD2.mobile
                 let v = this.formD2.captcha
-                if (m && v && v.length == 6 && this.isPhone(m)) this.ISFill = true
+                if (m && v && v.length == 5 && this.isPhone(m)) this.ISFill = true
                 else this.ISFill = false
             } else {
                 let u = this.formD.username

+ 26 - 58
src/pages/product/p_details.vue

@@ -15,30 +15,30 @@
 		<!-- 轮播图-end -->
 		
 		<!-- 价格信息栏 -->
-		<!-- <view class="price_info flex_r flex_ac flex_jb">
-			<view class="price" :class="type == 2 ? 'samll' : ''"><text v-if="type != 2"></text>{{type != 2 ? detail.price : detail.pfCombination}}</view>
+		<view class="price_info flex_r flex_ac flex_jb">
+			<view class="price" :class="type == 2 ? 'samll' : ''">¥{{detail.cost_price}}</view>
 			<view class="price_span flex_r flex_ac flex_je">
 				<view class="triangle"></view>
-				<view class="span_conten flex_r flex_ac flex_jc">{{type == 1 ? '零售专区' : type == 2 ? '批发专区' : type == 3 ? '合伙人套餐' : type == 4 ? 'CHA专区' : '今日值得买'}}</view>
+				<view class="span_conten flex_r flex_ac flex_jc">{{goodsDa.type == 1 ? "零售专区" : goodsDa.type == 2 ? "批发专区" : goodsDa.type == 3 ? "精品专区" : "今日值买"}}</view>
 			</view>
-		</view> -->
+		</view>
 		<!-- 价格信息栏-end -->
 		
 		<!-- 标题信息栏 -->
-		<!-- <view class="title_info">
-			<view class="goods_name">{{ type != 3 ? detail.goodsName : detail.title}}</view>
+		<view class="title_info">
+			<view class="goods_name">{{ detail.goods.goods_name}}</view>
 			<view class="goods_subName">{{detail.goodsMsg}}</view>
-		</view> -->
+		</view>
 		<!-- 标题信息栏-end -->
 		
 		<!-- 产品简介 -->
-		<!-- <view class="brief mar_t20">
+		<view class="brief mar_t20">
 			<view class="brief_title flex_r flex_ac">产品简介</view>
 			<view class="brief_con">
-				<jyfParser :html="detail.goodsDesc" ref="jyf"></jyfParser>
-				<image :lazy-load="true" style="width: 100%;display: block;" v-for="(item,index) in detail.goodsDetailesImage" :key="index" :src="item" mode="widthFix"></image>
+				<jyfParser :html="detail.goods.goods_content" ref="jyf"></jyfParser>
+				<!-- <image :lazy-load="true" style="width: 100%;display: block;" v-for="(item,index) in detail.goodsDetailesImage" :key="index" :src="item" mode="widthFix"></image> -->
 			</view>
-		</view> -->
+		</view>
 		<!-- 产品简介-end -->
 		
 		<!-- 底部导航组件 -->
@@ -119,18 +119,18 @@ import authorizeModule from '@/components/authorize-module/index'
 						icon: 'home',
 						text: '主页'
 					},
-					{
-						icon: 'cart',
-						text: '购物车',
-						info: 0
-					}
+					// {
+					// 	icon: 'cart',
+					// 	text: '购物车',
+					// 	info: 0
+					// }
 				],
 				buttonGroup: [ // 底部操作按钮
-					{
-						text: '加入购物车',
-						backgroundColor: '#ff0000',
-						color: '#fff'
-					},
+					// {
+					// 	text: '加入购物车',
+					// 	backgroundColor: '#ff0000',
+					// 	color: '#fff'
+					// },
 					{
 						text: '立即购买',
 						backgroundColor: '#ffa200',
@@ -138,10 +138,12 @@ import authorizeModule from '@/components/authorize-module/index'
 					}
 				],
 				btnIndex : 0 ,// 用户点击按钮事件判断 0:加入购物车;1:立即购买
-				type: null ,// 商品类型,1:零售,2:批发;3:套餐;
+				type: null ,// 商品类型,1零售 2批发 3精品 4今日值买
 				goodsId:'' ,// 商品ID
 				id:'' ,//合伙人套餐ID
-				detail:'' ,// 商品详情
+				detail: {
+					goods:{}
+				} ,// 商品详情
 				checked:false, //是否选中协议
 				buyNum: 1 ,//购买数量
 				pfway: "0" ,// 批发
@@ -154,43 +156,9 @@ import authorizeModule from '@/components/authorize-module/index'
 		onLoad:function(e){
 			this.goodsDa = e;
 			this.userinfo = uni.getStorageSync('userinfo');
-			// this.type=e.type
-			// if(e.type == 3){
-			// 	this.id = e.id
-			// }else{
-			// 	this.goodsId = e.id
-			// }
-			// if(e.type == 3 || e.type == 2 || e.type == 4 || e.type == 7){
-			// 	this.buttonGroup.shift()
-			// }
-			// //推荐人ID
-			// if (e.agentId) {
-			//     app.globalData.agentId = e.agentId;
-			// }
-			// if (e && e.scene){
-			//     var scene = decodeURIComponent(e.scene).split("&");
-			//     if (scene.length > 0) {
-			//         var agentId = scene[0].split(":");
-			//         app.globalData.agentId = agentId[1] && agentId[1] != '' ? agentId[1] : app.globalData.agentId;
-			//         var goodsId = scene[1].split(":");
-			//         this.goodsId = goodsId[1] && goodsId[1] != '' ? goodsId[1] : ''
-			//     }
-			// }
 			this.loadData(e)
 		},
-		onShow:function(){
-			// let that = this;
-			// let userId = app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId ? app.globalData.systemUserInfo.userId : '';
-			// if (!userId || userId == '' || userId==undefined) {
-			// 	that.showAuth=true
-			// 	appEv.authorizeUserInfo(res=>{
-			// 		if(res){
-			// 			that.shopInfo=app.globalData.shopInfo
-			// 			that.showAuth=false
-			// 		}
-			// 	})
-			// }
-		},
+		onShow:function(){},
 		methods:{
 			// 商品详情信息
 			loadData(da){

+ 29 - 127
src/pages/to-pay-list/index.vue

@@ -27,11 +27,11 @@
 		
 		<!-- 商品信息 -->
 		<view class="goods_info mar_t20">
-			<view class="info_type">专区</view>
+			<view class="info_type">{{modularName}}</view>
 			<view class="goods flex_r">
 				<image class="goods_img" :src="goodsInfo.goods.original_img" mode=""></image>
 				<view class="goods_con flex_c flex_jc flex_jb">
-					<view class="goods_name">{{goodsInfo.goods.goods_name}}</view>
+					<view class="goods_name ellipsis2">{{goodsInfo.goods.goods_name}}</view>
 					<view class="flex_r flex_ac flex_jb">
 						<view class="goods_msg">{{Data.type == 2 ? goodsInfo.trade_num + '消费积分' + '¥' + goodsInfo.trade_price : '¥' + goodsInfo.cost_price}}</view>
 						<view class="goods_num">x {{Data.num}}</view>
@@ -70,7 +70,7 @@
 			</view>
 			<view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 5">
 				<view class="list_name flex_r flex_jb"><text>商</text><text>品</text><text>金</text><text>额</text></view>
-				<view class="list_con">¥{{basicsInfo.goodsTotalPrice}}</view>
+				<view class="list_con">¥{{Data.type == 2 ? goodsInfo.trade_price : goodsInfo.cost_price}}</view>
 			</view>
 			<view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 5">
 				<view class="list_name flex_r flex_jb"><text>消</text><text>费</text><text>积</text><text>分</text></view>
@@ -93,6 +93,10 @@
 			<view class="pay_btn flex_r flex_ac flex_jc" @tap="payment">立即支付</view>
 		</view>
 		<!-- 底部操作栏-end -->
+
+		<!-- 收获地址弹窗 -->
+		<userAddress ref="userAddress" @addressConfirm="loadAddress" />
+
 	</view>
 </template>
 
@@ -101,9 +105,7 @@ let page = 1;
 let app=getApp();
 var appEv = app.$vm.$options;
 import { get, post, u_post } from "@/request/api.js";
-// let reqApi = new ReqApi();
-// var toPayOpre = new ToPayOpre();
-// import { ReqApi, ToPayOpre } from "../../utils/reqTools.js";
+import userAddress from "pages/xghc-addrress/userAddress"
 	export default {
 		data() {
 			return {
@@ -118,11 +120,20 @@ import { get, post, u_post } from "@/request/api.js";
 				obligation: 0, //待支付
 			};
 		},
+		components: {
+			userAddress,
+		},
 		onLoad(e){
 			this.Data = e
-			this.loadData(e)
-			// this.loadAddress()
+			this.loadData(e);
+			this.loadAddress();
+
 			this.userinfo = uni.getStorageSync('userinfo');
+			// 1零售 2批发 3精品 4今日值买
+			this.modularName = e.type == 1 ? "零售专区" : e.type == 2 ? "批发专区" : e.type == 3 ? "精品专区" : "今日值买"
+		},
+		mounted () {
+			// this.$refs.popup.open('top');
 		},
 		methods:{
 			loadData(da){
@@ -140,6 +151,9 @@ import { get, post, u_post } from "@/request/api.js";
 						})
 					}
                 })
+			},
+			// 获取用户地址
+			loadAddress(){
 				post("user/addressList").then(res => {
                     if(res.code === 0){
 						let da = res.data.data;
@@ -150,137 +164,25 @@ import { get, post, u_post } from "@/request/api.js";
 							}else this.DefaultAddress = da[0]
 						}
 					}
-                })
-                // u_post("ShuZiTeaYW/shop/confirmOrder",this.Data).then(res => {
-                //     if(res.status == 200){
-                //         that.goodsInfo = res.goodsInfo
-                //         that.basicsInfo = res.basicsInfo
-                //         that.modularName = res.modularName
-                //     }
-                // })
-			},
-
-			// 获取用户地址
-			loadAddress:function(){
-				let that = this;
-                u_post("ShuZiTeaYW/shop/userDefaultAddress").then(res => {
-                    if(res.status == 200){
-							that.DefaultAddress = res.date
-                    }
                 })
 			},
 			chooseWXaddress() {
-				this.goto("/pages/xghc-addrress/userAddress");
-				// var that = this;
-				// uni.chooseAddress({
-				// 	success: function (res) {
-				// 		let default_address = {
-				// 			city: res.cityName,
-				// 			county: res.countyName,
-				// 			address: res.detailInfo,
-				// 			zipCode: res.postalCode,
-				// 			province: res.provinceName,
-				// 			mobile: res.telNumber,
-				// 			name: res.userName
-				// 		};
-				// 		that.DefaultAddress = default_address;
-				// 	},
-				// 	fail: function (res) {
-				// 		console.log(res);
-				// 		if (res.errMsg == "chooseAddress:fail auth deny" || res.errMsg == "chooseAddress:fail:auth denied") {
-				// 			that.flag = false;
-				// 		}
-				// 	}
-				// })
+				this.$refs.userAddress.open();
+				// this.goto("/pages/xghc-addrress/userAddress");
 			},
 			// 支付
 			payment:function(){
+				if(!this.DefaultAddress.id){
+					appEv.errTips('请选择地址')
+					return
+				}
 				post('goods/submitOrder',{
 					...this.Data,
 					address_id: this.DefaultAddress.id,
 				}).then(res => {
 
 				})
-				// let that = this;
-				// if(this.DefaultAddress == '' && this.Data.ojsType!=2){
-				// 	appEv.errTips('请选择地址')
-				// 	return false
-				// }
-				// let data = {
-				// 	goodsType:this.Data.goodsType,
-				// 	buyCount:this.Data.count,
-				// 	payType:this.Data.payType ? this.Data.payType : 1,
-				// 	ojsType:this.Data.ojsType ? this.Data.ojsType : ''
-				// }
-				// if(this.Data.goodsType == 6){
-				// 	data.shoppingCartId=this.Data.goodsId
-				// }else if(this.Data.goodsType == 4){
-				// 	data.shoppingCartId=this.Data.goodsPId
-				// }else{
-				// 	data.goodsId=this.Data.goodsId
-				// }
-				// if(this.Data.ojsType!=2){
-				// 	if(this.DefaultAddress.id && this.DefaultAddress.id != ''){
-				// 		data.addressId=this.DefaultAddress.id
-				// 	}else{
-				// 		data = {
-				// 			...data,
-				// 			province : this.DefaultAddress.province,
-				// 			city : this.DefaultAddress.city,
-				// 			county : this.DefaultAddress.county,
-				// 			address : this.DefaultAddress.address,
-				// 			name : this.DefaultAddress.name,
-				// 			mobile : this.DefaultAddress.mobile
-				// 		}
-				// 	}
-				// }
-				// uni.showModal({
-				//     title: '提示',
-				//     content: '是否确认支付',
-				//     success: function (res) {
-				//         if (res.confirm) {
-				// 			let info = null
-				// 			if(that.Data.goodsType == 6 || that.Data.goodsType == 4){
-				// 				info = reqApi.ShoppingCartBuy(data)
-				// 			}else{
-				// 				info = reqApi.placeOrders(data)
-				// 			}
-				//             if(info){
-				//             	info.then(res => {
-				//             		if(res.data.status == 200){
-				//             			if(res.data.payParam){
-				//             				toPayOpre.toPay(res.data.payParam, (res) => {
-				//             					if (!res) {
-				//             						// 支付成功
-				//             						uni.redirectTo({
-				//             							url: '/pages/szw-order-list/index'
-				//             						})
-				//             					} else {
-				//             						// 支付失败
-				//             						uni.redirectTo({
-				//             							url: '/pages/szw-order-list/index'
-				//             						})
-				//             					}
-				//             				});
-				//             			}else{
-				//             				appEv.errTips('支付成功')
-				// 							// 支付成功
-				// 							uni.redirectTo({
-				// 								url: '/pages/szw-order-list/index'
-				// 							})
-				//             			}
-				//             		}else{
-				//             			appEv.errTips(res.data.msg)
-				//             		}
-				//             	})
-				//             }
-				//         } else if (res.cancel) {
-				//             console.log('用户点击取消');
-				//         }
-				//     }
-				// });
-				
-			}
+			},
 		}
 	}
 </script>

+ 214 - 53
src/pages/xghc-addrress/userAddress.vue

@@ -1,53 +1,86 @@
 <template>
-	<view class="container">
-		<form @submit="formSubmit">
-			<view class='addAddress'>
-				<view class="pad30">
-					<view class='default acea-row row-middle borderRadius15'>
-						<uni-easyinput type="textarea" v-model="addressValue" placeholder="粘贴地址信息,自动拆分姓名、电话和地址" @blur="identify()" />
-						<!-- <input v-model="addressValue" type="text" placeholder="粘贴地址信息,自动拆分姓名、电话和地址" 
-						placeholder-class='placeholder' style="width:100%;" 
-						@blur="identify()"> -->
-					</view>
-				</view>
-				<view class="pad30 mt-22">
-					<view class='list borderRadius15'>
-						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>姓名</view>
-							<input type='text' placeholder='请输入姓名' name='real_name' v-model="userAddress.real_name"
-								placeholder-class='placeholder' />
-						</view>
-						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>联系电话</view>
-							<input type='number' placeholder='请输入联系电话' name="phone" v-model='userAddress.phone'
-								placeholder-class='placeholder' pattern="\d*" />
+	<uni-popup ref="popup" type="bottom">
+		<view class="container">
+			<div class="tit">
+				<text class="close">关闭</text>
+			</div>
+			<form @submit="formSubmit" v-if="isadd">
+				<view class='addAddress'>
+					<view class="pad30">
+						<view class='default acea-row row-middle borderRadius15'>
+							<uni-easyinput type="textarea" v-model="addressValue" placeholder="粘贴地址信息,自动拆分姓名、电话和地址" @blur="identify()" />
 						</view>
-						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>所在地区</view>
-							<view class="address acea-row row-between">
-								<input type='text' placeholder='请填写具体地址' name='region' placeholder-class='placeholder'
-									v-model='userAddress.region' class="detail" />
+					</view>
+					<view class="pad30 mt-22">
+						<view class='list borderRadius15'>
+							<view class='item acea-row row-between-wrapper'>
+								<view class='name'>姓名</view>
+								<input type='text' placeholder='请输入姓名' name='real_name' v-model="userAddress.real_name"
+									placeholder-class='placeholder' />
 							</view>
-						</view>
-						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>详细地址</view>
-							<view class="address">
-								<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder'
-									v-model='userAddress.detail' class="detail" />
+							<view class='item acea-row row-between-wrapper'>
+								<view class='name'>联系电话</view>
+								<input type='number' placeholder='请输入联系电话' name="phone" v-model='userAddress.phone'
+									placeholder-class='placeholder' pattern="\d*" />
 							</view>
-						</view>
-						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>详细地址</view>
-							<view class="address">
-								<uni-data-checkbox v-model="is_default" :localdata="range"></uni-data-checkbox>
+							<view class='item acea-row row-between-wrapper'>
+								<view class='name'>所在地区</view>
+								<view class="address acea-row row-between">
+									<input type='text' placeholder='请填写具体地址' name='region' placeholder-class='placeholder'
+										v-model='userAddress.region' class="detail" />
+								</view>
+							</view>
+							<view class='item acea-row row-between-wrapper'>
+								<view class='name'>详细地址</view>
+								<view class="address">
+									<input type='text' placeholder='请填写具体地址' name='detail' placeholder-class='placeholder'
+										v-model='userAddress.detail' class="detail" />
+								</view>
+							</view>
+							<view class='item acea-row row-between-wrapper'>
+								<view class='name'>详细地址</view>
+								<view class="address">
+									<uni-data-checkbox v-model="is_default" :localdata="range"></uni-data-checkbox>
+								</view>
 							</view>
 						</view>
 					</view>
+					<button class='keepBnt bg-color' form-type="submit">立即保存</button>
+				</view>
+			</form>
+
+			<div class="editaddress" v-else>
+				<view class="addbar" @click="isadd = true">
+					<text class="iconfont sp">&#xe760;</text>
+					<text class="sp">添加地址</text>
 				</view>
-				<button class='keepBnt bg-color' form-type="submit">立即保存</button>
-			</view>
-		</form>
-	</view>
+				<uni-swipe-action class="swipeAction">
+					<uni-swipe-action-item class="swipeAction_item" v-for="(i,s) in addressList" :key="s">
+						<view class="addressLi clearfix" @click="onSelect(i,s)">
+							<view class="addressLi_l">
+								<text v-if="i.status != 1" class="iconfont">&#xe623;</text>
+								<text v-else class="iconfont pitchOn">&#xe624;</text>
+							</view>
+							<view class="addressLi_r">
+								<view class="user">
+									<text class="name">{{i.name}}</text>
+									<text>{{i.mobile}}</text>
+								</view>
+								<view class="address">{{i.address}}</view>
+							</view>
+						</view>
+						<template v-slot:right>
+							<view class="btns clearfix">
+								<view class="btn edit"><text class="iconfont">&#xe600;</text></view>
+								<view class="btn del"><text class="iconfont">&#xe601;</text></view>
+							</view>
+						</template>
+					</uni-swipe-action-item>
+				</uni-swipe-action>
+			</div>
+
+		</view>
+	</uni-popup>
 </template>
 <script>
 import { get, post, u_post } from "@/request/api.js";
@@ -65,14 +98,15 @@ var appEv = app.$vm.$options;
 				}, //地址详情
 				addressValue:"",
 				is_default: 0, //是否设为默认地址
-				range: [{"value": 0,"text": "否"	},{"value": 1,"text": "是"}]
+				range: [{"value": 0,"text": "否"	},{"value": 1,"text": "是"}],
+				
+				isadd: false,
+				addressList: [],
 			}
 		},
-		components:{
-			
-		},
-		onLoad(){
-			
+		components:{},
+		created () {
+			this.loadAddress();
 		},
 		methods: {
 			identify(){
@@ -101,11 +135,47 @@ var appEv = app.$vm.$options;
                 	if (res.code === 0) {
 						appEv.errTips(res.msg);
 						setTimeout(() => {
-							uni.navigateBack();
+						// 	uni.navigateBack();
+							this.$emit('addressConfirm');
+							this.close();
 						}, 1500);
 					}
 				})
-				// this.$emit('addressConfirm',this.userAddress)
+			},
+			// 获取用户地址
+			loadAddress(){
+				post("user/addressList").then(res => {
+                    if(res.code === 0){
+						this.addressList = res.data.data;
+					}
+                })
+			},
+			onSelect(i,s){
+				this.addressList.forEach(e => {
+					e.status = "0";
+				});
+				this.addressList[s].status = "1";
+				this.editAddress();
+			},
+			editAddress(){
+				this.addressList.forEach((e,s) => {
+					post("user/editAddress",{
+						...e, is_default: e.status
+					}).then(res=>{
+						if(this.addressList.length == s+1){
+							this.$emit('addressConfirm');
+							this.close();
+						}
+					})
+				});
+			},
+
+			open(type) {
+				this.$refs.popup.open('bottom')
+				if(type == "add") this.isadd = true
+			},
+			close() {
+				this.$refs.popup.close()
 			}
 		},
 	}
@@ -113,8 +183,9 @@ var appEv = app.$vm.$options;
 <style lang="scss" scoped>
 	.container{
 		background-color: #f5f5f5;
-		height: 100vh;
-		padding-top:30rpx;
+		height: 70vh;
+		// padding:30rpx 0;
+		border-radius: 30rpx 30rpx 0 0;
 	}
 	
 	.pad30 {
@@ -233,6 +304,96 @@ var appEv = app.$vm.$options;
 		margin-top: 22rpx;
 	}
 	.bg-color {
-		background-color: #dd524d;
+		background-color: #2DB389;
+	}
+
+	.addbar{
+		background: #fff;
+		text-align: center;
+		margin-bottom: 50rpx;
+		padding: 36rpx 0;
+		.iconfont{
+			font-size: 46rpx;
+			margin-right: 20rpx;
+		}
+		.sp{
+			vertical-align: middle;
+		}
+	}
+
+	.swipeAction{
+		// padding: 20rpx 30rpx;
+		font-size: 28rpx;
+
+		.addressLi{
+			.addressLi_l{
+				width: 80rpx;
+				height: 80rpx;
+				display: flex;
+				// justify-content: center;
+				align-items: center;
+				.iconfont{
+					color: #666;
+					font-size: 38rpx;
+				}
+				.pitchOn{
+					color: #1989fa;
+				}
+			}
+			.addressLi_r{
+				width: calc(100% - 80rpx);
+			}
+			.addressLi_l,.addressLi_r{
+				float: left;
+			}
+			.user{
+				margin-bottom: 10rpx;
+			}
+			.name{
+				// font-weight: bold;
+				font-size: 32rpx;
+				margin-right: 10rpx;
+			}
+			.address{
+				font-size: 24rpx;
+				color: #999;
+			}
+		}
+
+		.swipeAction_item{
+			background: #fff;
+			margin-bottom: 20rpx;
+		}
+
+		.btns{
+			.btn{
+				float: left;
+				display:flex;
+				justify-content : center;
+				align-items : center; 
+				height: 100%;
+				padding: 0 30rpx;
+				color: #fff;
+				font-size: 36rpx;
+				
+			}
+			.edit{
+				background: rgba(25,137,250,0.5);
+			}
+			.del{
+				background: rgba(238,10,36,0.5);
+			}
+		}
+	}
+
+	::v-deep .uni-swipe_box{
+		padding: 20rpx 30rpx;
+	}
+
+	.tit{
+		padding: 10rpx 0;
+		.close{
+			float: right;
+		}
 	}
 </style>

BIN
src/static/consent.png


+ 50 - 0
src/utils/reqTools.js

@@ -0,0 +1,50 @@
+var app = getApp();
+var appEv = app.$vm.$options;
+
+class ToPayOpre {
+    // 支付
+    toPay(info = appEv.parameter("info"), callback) {
+        var that = this;
+		console.log('info',info)
+        uni.requestPayment({
+            ...info,
+            success: function (res) {
+                that.payReturn(false, callback);
+            },
+            fail: function (res) {
+				console.log(res,"报错信息")
+                that.payReturn(true, callback);
+            }
+        })
+    }
+    payReturn(isFail, callback) {
+        uni.hideLoading();
+        // 支付失败
+        if (isFail) {
+            appEv.errTips('支付失败', 3000);
+        } else {
+            // 支付成功
+            uni.showToast({
+                title: '支付成功',
+                icon: 'success',
+                duration: 1200,
+                mask: true
+            })
+        }
+        
+        // 跳转订单列表
+        setTimeout(function () {
+            if (callback) {
+                callback(isFail);
+            } else {
+                uni.redirectTo({
+                    url: '/pages/chengbei-order-list/index'
+                })
+            }
+        }, 1200);
+    }
+}
+
+export {
+    ToPayOpre
+}

+ 45 - 1
src/utils/utils.js

@@ -542,6 +542,49 @@ function checkPhoneNum(str){
     return phoneTest.test(str);
 }
 
+class ToPayOpre {
+    // 支付
+    toPay(info = appEv.parameter("info"), callback) {
+        var that = this;
+        uni.requestPayment({
+            ...info,
+            success: function (res) {
+                that.payReturn(false, callback);
+            },
+            fail: function (res) {
+                that.payReturn(true, callback);
+            }
+        })
+    }
+    payReturn(isFail, callback) {
+        uni.hideLoading();
+        // 支付失败
+        if (isFail) {
+            appEv.errTips('支付失败', 3000);
+        } else {
+            // 支付成功
+            uni.showToast({
+                title: '支付成功',
+                icon: 'success',
+                duration: 1200,
+                mask: true
+            })
+        }
+        
+        // 跳转订单列表
+        setTimeout(function () {
+            if (callback) {
+                callback(isFail);
+            } else {
+                uni.redirectTo({
+                    url: '/pages/chengbei-order-list/index'
+                })
+            }
+        }, 1200);
+    }
+}
+
+
 module.exports = {
     compareVersion: compareVersion,
     formatTime: formatTime,
@@ -557,5 +600,6 @@ module.exports = {
     emoji_uncodeUtf16,
     formatDateTime,
     transformContentToMultiLineText,
-    getTwoFloat
+    getTwoFloat,
+	ToPayOpre
 }