Browse Source

fix:全局去除u_post

DaMowang 3 years ago
parent
commit
9b2fbc88a0

+ 1 - 1
src/components/goodsList.vue

@@ -16,7 +16,7 @@
     </view>
 </template>
 <script>
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
     name: "goodslist",
     components: {},

+ 0 - 2
src/pages/about/index.vue

@@ -8,11 +8,9 @@
 
 <script>
 let app=getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { post } from "@/request/api.js";
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
-// import { ReqApi } from "@/utils/reqTools.js";
 	export default {
 		data() {
 			return {

+ 3 - 140
src/pages/account/consignment.vue

@@ -24,53 +24,6 @@
 		</view>
 		<!-- 寄售列表-end -->
 		<not-goods v-if="haveGoods" textStr="暂无寄售信息"></not-goods>
-		
-		<!-- 兑换弹窗 -->
-		<uni-popup type="center" ref="conversion">
-			<view class="const_con">
-				<image class="closePopup" src="/static/f_close.png" mode="" @tap="closePopup"></image>
-				<view class="const_head flex_r flex_ac flex_jc y_color">寄售失败</view>
-				<view class="const_info flex_r flex_ac flex_jc">
-					<view class="frist_list flex_c">
-						<view class="flex_r flex_ac" @tap="setPayWay(0)">
-							<image class="frist_img" :src="pay_way == 0 ? '/static/xuanzhong_icon.png' : '/static/weixuanzhong_icon.png'" mode=""></image>
-							<view class="frist_text">再次寄售</view>
-						</view>
-					</view>
-					<view class="frist_list flex_c">
-						<view class="flex_r flex_ac" @tap="setPayWay(1)">
-							<image class="frist_img" :src="pay_way == 1 ? '/static/xuanzhong_icon.png' : '/static/weixuanzhong_icon.png'" mode=""></image>
-							<view class="frist_text">发货邮寄</view>
-						</view>
-					</view>
-				</view>
-				<!-- 收货地址 -->
-				<view class="address" v-if="pay_way == 1">
-					<block v-if="DefaultAddress != ''">
-						<view class="add_head flex_r flex_ac flex_jb">
-							<view class="user_info flex_r flex_ac">
-								<view class="user_name">{{DefaultAddress.name}}</view>
-								<view class="user_phone">{{DefaultAddress.mobile}}</view>
-							</view>
-							<view class="set_address flex_r flex_ac" @tap="chooseWXaddress">
-								<image class="set_img" src="/static/setAddress.png" mode=""></image>
-								<view class="set_text">修改</view>
-							</view>
-						</view>
-						<view class="add_name mar_t20">{{DefaultAddress.province}}{{DefaultAddress.city}}{{DefaultAddress.county}}{{DefaultAddress.address}}</view>
-					</block>
-					<block v-else>
-						<view class="add_address flex_c flex_ac flex_jc" @tap="chooseWXaddress">
-							<image class="add_icon" src="/static/add.png" mode=""></image>
-							<view class="add_text">添加收货地址</view>
-						</view>
-					</block>
-				</view>
-				<!-- 收货地址-end -->
-				<view class="conversion flex_r flex_ac flex_jc" @tap="SetConsign(pay_way)">确认</view>
-			</view>
-		</uni-popup>
-		<!-- 兑换弹窗-end -->
 	</view>
 </template>
 
@@ -78,9 +31,7 @@
 let page = 1;
 let app=getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import notGoods from '@/components/not-goods/index.vue'
 import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	export default {
@@ -151,105 +102,17 @@ import uniPopup from '@/components/uni-popup/uni-popup.vue'
                 })
 			},
 			// 修改
-			SetCurrent:function(i){
+			SetCurrent(i){
 				this.current = i;
 				this.haveGoods = false;
 				page = 1;
 				this.goods = []
 				this.loadData()
 			},
-			// 修改操作方式
-			setPayWay:function(i){
-				this.pay_way = i;
-			},
 			// 跳转加速
 			navToSpeedUp(item,index){
 				this.goto("/pages/speed-up/index",{id:item.id})
-
-				// if(item.ojsType != 3){
-				// 	uni.navigateTo({
-				// 		url:'/pages/speed-up/index?id=' + item.id
-				// 	})
-				// }
-				// else if(item.ojsType == 3){
-				// 	this.selectIndex = index
-				// 	this.$refs.conversion.open()
-				// }
-			},
-			// 关闭立即兑换弹窗
-			closePopup:function(){
-				this.$refs.conversion.close()
-			},
-			// 点击操作失败事件
-			SetConsign:function(i){
-				let that = this;
-				let data = {
-					ojsId:this.goods[this.selectIndex].ojsId,
-					type:i + 1
-				}
-				if(i == 1){
-					if(this.DefaultAddress.id&&this.DefaultAddress.id!=''){
-						data = {
-							...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
-						}
-					}
-				}
-				u_post("ojs/updateOjsType",data).then(res => {
-                    if(res.status == 200){
-                        appEv.errTips(res.msg)
-                        that.$refs.conversion.close()
-                        page = 1;
-                        that.haveGoods = false;
-                        that.goods = []
-                        that.loadData()
-                    }else{
-                        appEv.errTips(res.msg)
-                    }
-                })
-			},
-			// 获取用户地址
-			loadAddress:function(){
-				let that = this;
-                u_post("ShuZiTeaYW/shop/userDefaultAddress").then(res => {
-                    if(res.status == 200){
-                        that.DefaultAddress = res.date
-                    }
-                })
-			},
-			chooseWXaddress:function() {
-				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;
-						}
-					}
-				})
-			},
+			}
 		},
 		onShareAppMessage() {
 			let userinfo = uni.getStorageSync('userinfo');

+ 1 - 3
src/pages/account/giveAsPresent.vue

@@ -42,9 +42,7 @@
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
   data() {
     return {

+ 1 - 12
src/pages/account/wealth.vue

@@ -37,9 +37,7 @@
 let page = 1;
 let app=getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 	export default {
 		data() {
 			return {
@@ -48,18 +46,9 @@ import { get, post, u_post } from "@/request/api.js";
 			};
 		},
 		onLoad:function(){
-			// this.loadData()
 			this.userinfo = uni.getStorageSync("userinfo");
 		},
 		methods:{
-			loadData:function(){
-				let that = this;
-                u_post("ShuZiTeaYW/my/wealth").then(res => {
-                    if(res.status == 200){
-                        that.details = res
-                    }
-                })
-			},
 			goDetail:function(integralType,pageName){
 				uni.navigateTo({
 					url:'/pages/accountDetails/teaBaby'

+ 1 - 3
src/pages/accountDetails/integral.vue

@@ -36,9 +36,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();
-// import { ReqApi } from "@/utils/reqTools.js";
+import { get, post } from "@/request/api.js";
 import notGoods from "@/components/not-goods/index.vue";
 export default {
   components: {

+ 1 - 3
src/pages/accountDetails/running.vue

@@ -33,9 +33,7 @@
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import notGoods from "@/components/not-goods/index.vue";
 export default {
   components: {

+ 1 - 3
src/pages/accountDetails/teaBaby.vue

@@ -39,9 +39,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();
-// import { ReqApi } from "@/utils/reqTools.js";
+import { get, post } from "@/request/api.js";
 import notGoods from "@/components/not-goods/index.vue";
 export default {
   components: {

+ 1 - 3
src/pages/accountDetails/topup.vue

@@ -20,9 +20,7 @@
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import notGoods from "@/components/not-goods/index.vue";
 export default {
   components: {

+ 0 - 2
src/pages/accountDetails/withdraw.vue

@@ -50,9 +50,7 @@
 <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 notGoods from "@/components/not-goods/index.vue";
 

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

@@ -38,9 +38,7 @@
 <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";

+ 0 - 2
src/pages/course/index.vue

@@ -8,11 +8,9 @@
 
 <script>
 let app=getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { post } from "@/request/api.js";
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
-// import { ReqApi } from "@/utils/reqTools.js";
 	export default {
 		data() {
 			return {

+ 0 - 2
src/pages/integral-list/index.vue

@@ -113,9 +113,7 @@
 <script>
 let page = 1;
 let app = getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
-// import { ReqApi } from "@/utils/reqTools.js";
 import uniPopup from "@/components/uni-popup/uni-popup.vue";
 export default {
   components: { uniPopup },

+ 4 - 35
src/pages/invi-img/index.vue

@@ -60,8 +60,8 @@
 let app = getApp();
 var appEv = app.$vm.$options;
 var util = require("@/utils/utils.js");
-import { get, post, u_post } from "@/request/api.js";
-// import { ReqApi } from "../../utils/reqTools.js";
+import { get, post } from "@/request/api.js";
+// import { ReqApi } from "@/utils/reqTools.js";
 // var reqApi = new ReqApi();
 // import { base64ToPath } from "@/js_sdk/image-tools.js";
 export default {
@@ -133,42 +133,11 @@ export default {
     },
     // 专属海报接口
     getZsImg() {
-      var that = this;
-      that.save();
-    //   u_post("ShuZiTeaYW/twoCode/get").then((res) => {
-    //     if (res.status == 200) {
-    //       if (res.url) {
-    //         that.imgUrl = res.url;
-    //         that.save();
-    //       } else {
-    //         appEv.errTips("保存失败");
-    //         uni.hideLoading();
-    //       }
-    //     } else {
-    //       appEv.errTips(res.msg || "");
-    //     }
-    //   });
+      this.save();
     },
     // 收益海报接口
     getSyImg() {
-      var that = this;
-      that.save();
-    //   var imgs = reqApi.getSyInviImg();
-    //   if (imgs) {
-    //     imgs.then((res) => {
-    //       if (res.data.status == 200) {
-    //         if (res.data.twoCode) {
-    //           (that.imgUrl = res.data.twoCode), (that.userInfo = res.data);
-              
-    //         } else {
-    //           appEv.errTips("保存失败");
-    //           uni.hideLoading();
-    //         }
-    //       } else {
-    //         appEv.errTips(res.data.msg || "");
-    //       }
-    //     });
-    //   }
+      this.save();
     },
 
     save() {

+ 2 - 2
src/pages/my-credites/index.vue

@@ -44,8 +44,8 @@ let app = getApp();
 // var reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 // var https = app.globalData.ShopUrl;
-// var util = require("../../utils/util.js");
-// import { ReqApi } from "../../utils/reqTools.js";
+// var util = require("@/utils/util.js");
+// import { ReqApi } from "@/utils/reqTools.js";
 export default {
   data() {
     return {

+ 1 - 4
src/pages/my-tea-list/index.vue

@@ -106,11 +106,8 @@
 
 <script>
 let app = getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
-// import { ReqApi } from "@/utils/reqTools.js";
-// import uniCopy from "@/js_sdk/xb-copy/uni-copy.js";
-import uniCopy from "../../utils/copy";
+import uniCopy from "@/utils/copy";
 import popup from "@/components/uni-popup/uni-popup.vue";
 import { post } from "@/request/api.js";
 export default {

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

@@ -237,7 +237,6 @@
 		<!-- 授权 -->
 		<authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
 		<!-- 授权-end -->
-		<!-- <newauthorize ref="newauthorize" /> -->
 	</view>
 </template>
 
@@ -245,16 +244,9 @@
 	let page = 1;
 	let app = getApp();
 	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";
+	import { get, post } from "@/request/api.js";
 	export default {
 		components: {
 			authorizeModule,

+ 108 - 117
src/pages/my/userinfo.vue

@@ -1,156 +1,147 @@
 <template>
-  <view class="container">
-    <view class="list flex_r flex_ac">
-      <view class="list_title flex_r flex_ac flex_jb"
-        ><text>头</text><text>像:</text></view
-      >
-      <img
-        @click="upheadimg"
-        :src="formDa.head_pic"
-        alt=""
-        srcset=""
-        class="head_pic"
-      />
+    <view class="container">
+        <view class="list flex_r flex_ac">
+            <view class="list_title flex_r flex_ac flex_jb"><text>头</text><text>像:</text></view>
+            <img @click="upheadimg" :src="formDa.head_pic" alt="" srcset="" class="head_pic" />
+        </view>
+        <view class="list flex_r flex_ac">
+            <view class="list_title flex_r flex_ac flex_jb"><text>昵</text><text>称:</text></view>
+            <input type="text" class="flex_grow" v-model="formDa.nickname" placeholder="请输入昵称" />
+        </view>
+        <view class="confimBtn flex_r flex_ac flex_jc" @tap="upda">提交</view>
     </view>
-    <view class="list flex_r flex_ac">
-      <view class="list_title flex_r flex_ac flex_jb"
-        ><text>昵</text><text>称:</text></view
-      >
-      <input
-        type="text"
-        class="flex_grow"
-        v-model="formDa.nickname"
-        placeholder="请输入昵称"
-      />
-    </view>
-    <view class="confimBtn flex_r flex_ac flex_jc" @tap="upda">提交</view>
-  </view>
 </template>
-
 <script>
 let app = getApp();
 let appEv = app.$vm.$options;
 import { get, post } from "@/request/api.js";
 export default {
-  data() {
-    return {
-      formDa: {
-        nickname:undefined,
-        head_pic:undefined
-      },
-    };
-  },
-  onLoad() {
-    this.loadData();
-  },
-  methods: {
-    loadData() {
-      let da = uni.getStorageSync("userinfo");
-      this.formDa.nickname = da.nickname;
-      this.formDa.head_pic = da.head_pic;
+    data() {
+        return {
+            formDa: {
+                nickname: undefined,
+                head_pic: undefined
+            },
+        };
     },
-    upheadimg() {
-      // 上传图片uploadImg
-      let that = this;
-      uni.chooseImage({
-        count: 1, // 最多可以选择的图片张数,默认9
-        sizeType: ["compressed"], // original 原图,compressed 压缩图,默认二者都有
-        sourceType: ["album", "camera"], // album 从相册选图,camera 使用相机,默认二者都有
-        success: function (res) {
-          var arr = res.tempFiles;
-          that.$up(arr[0].path).then((res) => {
-            that.$set(that.formDa, "head_pic", res);
-            // that.formDa.head_pic = res;
-          });
-        },
-      });
+    onLoad() {
+        this.loadData();
     },
-    upda() {
-      post("user/setup", this.formDa).then((res) => {
-        if (res.code === 0) {
-          appEv.errTips(res.msg);
-          this.getuserInfo();
-          uni.navigateBack({
-            delta: 1, //返回层数,2则上上页
-          });
-        }
-      });
-    },
-    getuserInfo() {
-      post("/user/userinfo").then((res) => {
-        if (res.code === 0) {
-          uni.setStorageSync("userinfo", res.data.data);
-          this.loadData();
-        }
-      });
+    methods: {
+        loadData() {
+            let da = uni.getStorageSync("userinfo");
+            this.formDa.nickname = da.nickname;
+            this.formDa.head_pic = da.head_pic;
+        },
+        upheadimg() {
+            // 上传图片uploadImg
+            let that = this;
+            uni.chooseImage({
+                count: 1, // 最多可以选择的图片张数,默认9
+                sizeType: ["compressed"], // original 原图,compressed 压缩图,默认二者都有
+                sourceType: ["album", "camera"], // album 从相册选图,camera 使用相机,默认二者都有
+                success: function(res) {
+                    var arr = res.tempFiles;
+                    that.$up(arr[0].path).then((res) => {
+                        that.$set(that.formDa, "head_pic", res);
+                        // that.formDa.head_pic = res;
+                    });
+                },
+            });
+        },
+        upda() {
+            post("user/setup", this.formDa).then((res) => {
+                if (res.code === 0) {
+                    appEv.errTips(res.msg);
+                    this.getuserInfo();
+                    uni.navigateBack({
+                        delta: 1, //返回层数,2则上上页
+                    });
+                }
+            });
+        },
+        getuserInfo() {
+            post("/user/userinfo").then((res) => {
+                if (res.code === 0) {
+                    uni.setStorageSync("userinfo", res.data.data);
+                    this.loadData();
+                }
+            });
+        },
     },
-  },
 };
 </script>
-
 <style lang="scss">
 // 页面配置
 .container {
-  width: 100%;
-  overflow: hidden;
-  border-top: 20rpx solid #f5f5f5;
+    width: 100%;
+    overflow: hidden;
+    border-top: 20rpx solid #f5f5f5;
 }
+
 // 页面配置-end
 
 // 表单
 .list input {
-  font-size: 30rpx;
-  color: #343434;
+    font-size: 30rpx;
+    color: #343434;
 }
+
 .list_title {
-  width: 120rpx;
-  overflow: hidden;
-  margin-right: 100rpx;
-  font-size: 30rpx;
-  color: #535353;
+    width: 120rpx;
+    overflow: hidden;
+    margin-right: 100rpx;
+    font-size: 30rpx;
+    color: #535353;
 }
+
 .confimBtn {
-  width: 329rpx;
-  height: 73rpx;
-  margin: 74rpx auto 0;
-  background: #18bb88;
-  font-size: 40rpx;
-  color: #fff;
+    width: 329rpx;
+    height: 73rpx;
+    margin: 74rpx auto 0;
+    background: #18bb88;
+    font-size: 40rpx;
+    color: #fff;
 }
+
 .option {
-  width: 172rpx;
-  height: 54rpx;
-  border-radius: 4rpx;
-  background-color: #18bb88;
-  color: #fff;
-  font-size: 26rpx;
-  margin-left: 12rpx;
+    width: 172rpx;
+    height: 54rpx;
+    border-radius: 4rpx;
+    background-color: #18bb88;
+    color: #fff;
+    font-size: 26rpx;
+    margin-left: 12rpx;
 }
+
 .list {
-  width: 100%;
-  height: 92rpx;
-  background-color: #fff;
-  padding: 0 60rpx;
-  box-sizing: border-box;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
-  &:first-child {
-    height: 120rpx;
-    justify-content: space-between;
-  }
+    width: 100%;
+    height: 92rpx;
+    background-color: #fff;
+    padding: 0 60rpx;
+    box-sizing: border-box;
+    border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+
+    &:first-child {
+        height: 120rpx;
+        justify-content: space-between;
+    }
 }
 
 .g_color {
-  background-color: #e8e8e8;
-  color: #ff5758;
+    background-color: #e8e8e8;
+    color: #ff5758;
 }
+
 // 表单-end
 
 .flex_grow {
-  text-align: right;
+    text-align: right;
 }
+
 .head_pic {
-  width: 92rpx;
-  height: 92rpx;
-  border-radius: 50%;
+    width: 92rpx;
+    height: 92rpx;
+    border-radius: 50%;
 }
-</style>
+</style>

+ 0 - 2
src/pages/notice/index.vue

@@ -8,11 +8,9 @@
 
 <script>
 let app=getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { post } from "@/request/api.js";
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
-// import { ReqApi } from "@/utils/reqTools.js";
 	export default {
 		data() {
 			return {

+ 0 - 2
src/pages/pay-agreement/index.vue

@@ -6,11 +6,9 @@
 
 <script>
 let app = getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { post } from "@/request/api.js";
 import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
-// import { ReqApi } from "@/utils/reqTools.js";
 export default {
   data() {
     return {

+ 474 - 510
src/pages/product/p_details.vue

@@ -1,152 +1,101 @@
 <template>
-  <view class="container">
-    <!-- 轮播图 -->
-    <swiper-banner
-      imgScale="1:1"
-      :imgArr="detail.goods_img"
-      :duration="1000"
-      :interval="5000"
-      :circular="true"
-      :autoplay="true"
-      :indicator-dots="true"
-      indicator-active-color="#12B280"
-      indicator-color="rgba(255, 255, 255, .82)"
-    ></swiper-banner>
-    <!-- 轮播图-end -->
-
-    <!-- 价格信息栏 -->
-    <view class="price_info flex_r flex_ac flex_jb">
-      <view v-if="type == 5" class="price">
-        <span v-if="Number(detail.cost_price) != 0"
-          >{{ detail.cost_price }}元</span
-        >
-        <span
-          v-if="Number(detail.cha_bao) != 0 && Number(detail.cost_price) != 0"
-          >+</span
-        >
-        <span v-if="Number(detail.cha_bao) != 0">{{ detail.cha_bao }}茶宝</span>
-      </view>
-      <view v-else class="price" :class="type == 2 ? 'samll' : ''"
-        >¥{{ type == 2 ? detail.trade_price : 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">{{
-          goodsDa.type == 1
-            ? "零售专区"
-            : goodsDa.type == 2
-            ? "批发专区"
-            : goodsDa.type == 3
-            ? "精品专区"
-            : goodsDa.type == 4
-            ? "今日值得买"
-            : goodsDa.type == 5
-            ? "茶宝兑换"
-            : ""
-        }}</view>
-      </view>
-    </view>
-    <!-- 价格信息栏-end -->
-
-    <!-- 标题信息栏 -->
-    <view class="title_info">
-      <view class="goods_name">{{ detail.goods_name }}</view>
-      <view class="goods_subName">{{ detail.goodsMsg }}</view>
-    </view>
-    <!-- 标题信息栏-end -->
-
-    <!-- 产品简介 -->
-    <view class="brief mar_t20">
-      <view class="brief_title flex_r flex_ac">产品简介</view>
-      <view class="brief_con">
-        <jyfParser :html="detail.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>
-    <!-- 产品简介-end -->
-
-    <!-- 底部导航组件 -->
-    <view class="option">
-      <uni-goods-nav
-        :fill="true"
-        :options="options"
-        :buttonGroup="type == 5 ? buttonGroupTea : buttonGroup"
-        @click="onClick"
-        @buttonClick="buttonClick"
-      />
-    </view>
-    <!-- 底部导航组件-end -->
-    <!-- 授权 -->
-		<authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
-    <!-- 授权-end -->
-
-    <!-- 购买或加入购物车弹窗 -->
-    <uni-popup ref="shopping" type="bottom">
-      <view class="shopping">
-        <view class="close_con flex_r flex_je">
-          <image
-            class="close_img"
-            src="/static/close.png"
-            @tap="closeBtn"
-            mode=""
-          ></image>
+    <view class="container">
+        <!-- 轮播图 -->
+        <swiper-banner imgScale="1:1" :imgArr="detail.goods_img" :duration="1000" :interval="5000" :circular="true" :autoplay="true" :indicator-dots="true" indicator-active-color="#12B280" indicator-color="rgba(255, 255, 255, .82)"></swiper-banner>
+        <!-- 轮播图-end -->
+        <!-- 价格信息栏 -->
+        <view class="price_info flex_r flex_ac flex_jb">
+            <view v-if="type == 5" class="price">
+                <span v-if="Number(detail.cost_price) != 0">{{ detail.cost_price }}元</span>
+                <span v-if="Number(detail.cha_bao) != 0 && Number(detail.cost_price) != 0">+</span>
+                <span v-if="Number(detail.cha_bao) != 0">{{ detail.cha_bao }}茶宝</span>
+            </view>
+            <view v-else class="price" :class="type == 2 ? 'samll' : ''">¥{{ type == 2 ? detail.trade_price : 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">{{
+                    goodsDa.type == 1
+                    ? "零售专区"
+                    : goodsDa.type == 2
+                    ? "批发专区"
+                    : goodsDa.type == 3
+                    ? "精品专区"
+                    : goodsDa.type == 4
+                    ? "今日值得买"
+                    : goodsDa.type == 5
+                    ? "茶宝兑换"
+                    : ""
+                    }}</view>
+            </view>
+        </view>
+        <!-- 价格信息栏-end -->
+        <!-- 标题信息栏 -->
+        <view class="title_info">
+            <view class="goods_name">{{ detail.goods_name }}</view>
+            <view class="goods_subName">{{ detail.goodsMsg }}</view>
         </view>
-        <view class="goods_info flex_r">
-          <image class="goods_img" :src="detail.original_img" mode=""></image>
-          <view class="goods_con flex_c flex_jb">
-            <view class="shop_names">{{ detail.goods_name }}</view>
-            <!-- <view class="goods_msg">{{type == 2 ? detail.pfCombination : '¥' + detail.price}}</view> -->
-            <view class="num_con flex_r flex_je">
-              <uni-number-box
-                :min="1"
-                @change="bindChange"
-                :value="buyNum"
-              ></uni-number-box>
+        <!-- 标题信息栏-end -->
+        <!-- 产品简介 -->
+        <view class="brief mar_t20">
+            <view class="brief_title flex_r flex_ac">产品简介</view>
+            <view class="brief_con">
+                <jyfParser :html="detail.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>
-        <view class="goods_option flex_r flex_ac flex_jc" v-if="type == 2">
-          <view class="goods_raido flex_r flex_ac" @tap="setWay('1')">
-            <view
-              class="raido_img"
-              :class="pfway == '1' ? 'raido_box' : ''"
-            ></view>
-            <view class="raido_text">申请寄售</view>
-          </view>
-          <view class="goods_raido flex_r flex_ac" @tap="setWay('0')">
-            <view
-              class="raido_img"
-              :class="pfway == '0' ? 'raido_box' : ''"
-            ></view>
-            <view class="raido_text">发货邮寄</view>
-          </view>
+        <!-- 产品简介-end -->
+        <!-- 底部导航组件 -->
+        <view class="option">
+            <uni-goods-nav :fill="true" :options="options" :buttonGroup="type == 5 ? buttonGroupTea : buttonGroup" @click="onClick" @buttonClick="buttonClick" />
         </view>
-        <checkbox-group class="flex_r flex_ac flex_jc" @change="checkboxChange">
-          <label class="option_box">
-            <checkbox
-              value="1"
-              :checked="checked"
-              color="#2DB389"
-              style="transform: scale(0.7)"
-            />
-            我已阅读同意<text @tap.stop="getProPage" v-if="type != 5">《购买协议》</text>
-            <text @tap.stop="getProPage" v-else>《兑换协议》</text>
-          </label>
-        </checkbox-group>
-        <view class="confim flex_r flex_ac flex_jc" @tap="ToPayPage">确定</view>
-      </view>
-    </uni-popup>
-    <!-- 购买或加入购物车弹窗-end -->
-  </view>
+        <!-- 底部导航组件-end -->
+        <!-- 授权 -->
+        <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- 授权-end -->
+        <!-- 购买或加入购物车弹窗 -->
+        <uni-popup ref="shopping" type="bottom">
+            <view class="shopping">
+                <view class="close_con flex_r flex_je">
+                    <image class="close_img" src="/static/close.png" @tap="closeBtn" mode=""></image>
+                </view>
+                <view class="goods_info flex_r">
+                    <image class="goods_img" :src="detail.original_img" mode=""></image>
+                    <view class="goods_con flex_c flex_jb">
+                        <view class="shop_names">{{ detail.goods_name }}</view>
+                        <!-- <view class="goods_msg">{{type == 2 ? detail.pfCombination : '¥' + detail.price}}</view> -->
+                        <view class="num_con flex_r flex_je">
+                            <uni-number-box :min="1" @change="bindChange" :value="buyNum"></uni-number-box>
+                        </view>
+                    </view>
+                </view>
+                <view class="goods_option flex_r flex_ac flex_jc" v-if="type == 2">
+                    <view class="goods_raido flex_r flex_ac" @tap="setWay('1')">
+                        <view class="raido_img" :class="pfway == '1' ? 'raido_box' : ''"></view>
+                        <view class="raido_text">申请寄售</view>
+                    </view>
+                    <view class="goods_raido flex_r flex_ac" @tap="setWay('0')">
+                        <view class="raido_img" :class="pfway == '0' ? 'raido_box' : ''"></view>
+                        <view class="raido_text">发货邮寄</view>
+                    </view>
+                </view>
+                <checkbox-group class="flex_r flex_ac flex_jc" @change="checkboxChange">
+                    <label class="option_box">
+                        <checkbox value="1" :checked="checked" color="#2DB389" style="transform: scale(0.7)" />
+                        我已阅读同意<text @tap.stop="getProPage" v-if="type != 5">《购买协议》</text>
+                        <text @tap.stop="getProPage" v-else>《兑换协议》</text>
+                    </label>
+                </checkbox-group>
+                <view class="confim flex_r flex_ac flex_jc" @tap="ToPayPage">确定</view>
+            </view>
+        </uni-popup>
+        <!-- 购买或加入购物车弹窗-end -->
+    </view>
 </template>
-
 <script>
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-import { get, post, u_post } from "@/request/api.js";
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
+import { get, post } from "@/request/api.js";
 import uniPopup from "@/components/uni-popup/uni-popup.vue";
 import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
 import swiperBanner from "@/components/swiperBanner";
@@ -154,474 +103,489 @@ import uniGoodsNav from "@/components/uni-goods-nav/uni-goods-nav.vue";
 import uniNumberBox from "@/components/uni-number-box/uni-number-box.vue";
 import authorizeModule from "@/components/authorize-module/index";
 export default {
-  components: {
-    uniPopup,
-    jyfParser,
-    uniGoodsNav,
-    swiperBanner,
-    uniNumberBox,
-    authorizeModule,
-  },
-  data() {
-    return {
-      imgArr: ["/static/goods5.jpg"],
-      content: "",
-      options: [
-        // 底部导航跳转
-        {
-          icon: "home",
-          text: "主页",
-        },
-        // {
-        // 	icon: 'cart',
-        // 	text: '购物车',
-        // 	info: 0
-        // }
-      ],
-      buttonGroup: [
-        // 底部操作按钮
-        // {
-        // 	text: '加入购物车',
-        // 	backgroundColor: '#ff0000',
-        // 	color: '#fff'
-        // },
-        {
-          text:  "立即购买",
-          backgroundColor: "#ffa200",
-          color: "#fff",
-        },
-      ],
-      buttonGroupTea: [
-        // 底部操作按钮
-        // {
-        // 	text: '加入购物车',
-        // 	backgroundColor: '#ff0000',
-        // 	color: '#fff'
-        // },
-        {
-          text:  "立即兑换",
-          backgroundColor: "#ffa200",
-          color: "#fff",
-        },
-      ],
-      btnIndex: 0, // 用户点击按钮事件判断 0:加入购物车;1:立即购买
-      type: null, // 商品类型,1零售 2批发 3精品 4今日值买
-      goodsId: "", // 商品ID
-      id: "", //合伙人套餐ID
-      detail: {
-        goods: {},
-      }, // 商品详情
-      checked: false, //是否选中协议
-      buyNum: 1, //购买数量
-      pfway: "1", // 批发
-      shopInfo: {}, // 商铺信息
-      showAuth: false,
-
-      userinfo: {},
-      goodsDa: {},
-      unid: '',
-    };
-  },
-  onLoad: function (e) {
-    this.userinfo = uni.getStorageSync("userinfo");
-    let token = uni.getStorageSync("token");
-    this.type = e.type;
-    this.goodsDa = e;
-    this.loadData(e);
-
-    if(e.invite && !token) this.login(e.invite);
-  },
-  onShow: function () {},
-  methods: {
-    // 商品详情信息
-    loadData(da) {
-      post("goods/goodsDetail", da).then((res) => {
-        if (res.code === 0) {
-          this.detail = res.data.data;
-          let imgs = [];
-          imgs.push(this.detail.original_img);
-          imgs.push(...this.detail.goods_img);
-          this.detail.goods_img = imgs;
-        } else {
-          uni.showModal({
-            title: "提示",
-            content: res.msg,
-            showCancel: false,
-            success: function (res) {
-              if (res) {
-                uni.navigateBack({
-                  delta: 1,
-                });
-              }
-            },
-          });
-        }
-      });
-    },
-    // 去购买
-    ToPayPage: function () {
-      if (!this.checked) {
-        appEv.errTips("请阅读并同意购买协议");
-        return;
-      }
-      if (this.btnIndex == 0) {
-        this.toPayOrder();
-      }
-    },
-    // 创建购买订单
-    toPayOrder: function () {
-      let da = {
-        ...this.goodsDa,
-        num: this.buyNum,
-        is_sell: this.type == 2 ? this.pfway : '0'
-      }
-      this.goto("/pages/to-pay-list/index", da);
-    },
-    // 添加到购物车
-    SetCartGoodsList: function () {
-      let that = this;
-      let data = {
-        goodsId: this.goodsId,
-        buyCount: this.buyNum,
-        specialArea: this.type,
-      };
-      u_post("ShuZiTeaYW/shop/conShoppingCart", data).then((res) => {
-        if (res.status == 200) {
-          appEv.errTips("添加成功");
-          that.checked = false;
-          that.buyNum = 1;
-          that.$refs.shopping.close();
-        } else {
-          appEv.errTips(res.msg);
-        }
-      });
-    },
-    // 购买数量更改
-    bindChange(e) {
-      this.buyNum = e;
-    },
-    // 更改批发方式
-    setWay(e) {
-      this.pfway = e;
+    components: {
+        uniPopup,
+        jyfParser,
+        uniGoodsNav,
+        swiperBanner,
+        uniNumberBox,
+        authorizeModule,
     },
-    // 点击同意协议
-    checkboxChange(e) {
-      let index = e.detail.value.indexOf("1");
-      if (index != -1) {
-        this.checked = true;
-      } else {
-        this.checked = false;
-      }
-    },
-    // 点击底部主页购物车等按钮
-    onClick(e) {
-      if (e.index === 0) {
-        uni.switchTab({ url: "/pages/index/index" });
-      }
-    },
-    // 点击立即购买或加入购物车
-    buttonClick: function (e) {
-      this.btnIndex = e.index;
-      this.$refs.shopping.open();
-    },
-    // 点击关闭弹窗
-    closeBtn: function () {
-      this.$refs.shopping.close();
+    data() {
+        return {
+            imgArr: ["/static/goods5.jpg"],
+            content: "",
+            options: [
+                // 底部导航跳转
+                {
+                    icon: "home",
+                    text: "主页",
+                },
+                // {
+                //  icon: 'cart',
+                //  text: '购物车',
+                //  info: 0
+                // }
+            ],
+            buttonGroup: [
+                // 底部操作按钮
+                // {
+                //  text: '加入购物车',
+                //  backgroundColor: '#ff0000',
+                //  color: '#fff'
+                // },
+                {
+                    text: "立即购买",
+                    backgroundColor: "#ffa200",
+                    color: "#fff",
+                },
+            ],
+            buttonGroupTea: [
+                // 底部操作按钮
+                // {
+                //  text: '加入购物车',
+                //  backgroundColor: '#ff0000',
+                //  color: '#fff'
+                // },
+                {
+                    text: "立即兑换",
+                    backgroundColor: "#ffa200",
+                    color: "#fff",
+                },
+            ],
+            btnIndex: 0, // 用户点击按钮事件判断 0:加入购物车;1:立即购买
+            type: null, // 商品类型,1零售 2批发 3精品 4今日值买
+            goodsId: "", // 商品ID
+            id: "", //合伙人套餐ID
+            detail: {
+                goods: {},
+            }, // 商品详情
+            checked: false, //是否选中协议
+            buyNum: 1, //购买数量
+            pfway: "1", // 批发
+            shopInfo: {}, // 商铺信息
+            showAuth: false,
+
+            userinfo: {},
+            goodsDa: {},
+            unid: '',
+        };
     },
-    getProPage() {
-      uni.navigateTo({
-        url: "/pages/pay-agreement/index?type=" + this.goodsDa.type,
-      });
+    onLoad: function(e) {
+        this.userinfo = uni.getStorageSync("userinfo");
+        let token = uni.getStorageSync("token");
+        this.type = e.type;
+        this.goodsDa = e;
+        this.loadData(e);
+
+        if (e.invite && !token) this.login(e.invite);
     },
+    onShow: function() {},
+    methods: {
+        // 商品详情信息
+        loadData(da) {
+            post("goods/goodsDetail", da).then((res) => {
+                if (res.code === 0) {
+                    this.detail = res.data.data;
+                    let imgs = [];
+                    imgs.push(this.detail.original_img);
+                    imgs.push(...this.detail.goods_img);
+                    this.detail.goods_img = imgs;
+                } else {
+                    uni.showModal({
+                        title: "提示",
+                        content: res.msg,
+                        showCancel: false,
+                        success: function(res) {
+                            if (res) {
+                                uni.navigateBack({
+                                    delta: 1,
+                                });
+                            }
+                        },
+                    });
+                }
+            });
+        },
+        // 去购买
+        ToPayPage: function() {
+            if (!this.checked) {
+                appEv.errTips("请阅读并同意购买协议");
+                return;
+            }
+            if (this.btnIndex == 0) {
+                this.toPayOrder();
+            }
+        },
+        // 创建购买订单
+        toPayOrder: function() {
+            let da = {
+                ...this.goodsDa,
+                num: this.buyNum,
+                is_sell: this.type == 2 ? this.pfway : '0'
+            }
+            this.goto("/pages/to-pay-list/index", da);
+        },
+        // 添加到购物车
+        SetCartGoodsList() {},
+        // 购买数量更改
+        bindChange(e) {
+            this.buyNum = e;
+        },
+        // 更改批发方式
+        setWay(e) {
+            this.pfway = e;
+        },
+        // 点击同意协议
+        checkboxChange(e) {
+            let index = e.detail.value.indexOf("1");
+            if (index != -1) {
+                this.checked = true;
+            } else {
+                this.checked = false;
+            }
+        },
+        // 点击底部主页购物车等按钮
+        onClick(e) {
+            if (e.index === 0) {
+                uni.switchTab({ url: "/pages/index/index" });
+            }
+        },
+        // 点击立即购买或加入购物车
+        buttonClick: function(e) {
+            this.btnIndex = e.index;
+            this.$refs.shopping.open();
+        },
+        // 点击关闭弹窗
+        closeBtn: function() {
+            this.$refs.shopping.close();
+        },
+        getProPage() {
+            uni.navigateTo({
+                url: "/pages/pay-agreement/index?type=" + this.goodsDa.type,
+            });
+        },
 
-    
-    login(invite) {
-      let that = this;
-      // #ifdef  MP-WEIXIN
-      wx.login({
-        success(res) {
-          if (res.code) {
-            post("appletLogin", {
-              invite,
-              code: res.code,
+
+        login(invite) {
+            let that = this;
+            // #ifdef  MP-WEIXIN
+            wx.login({
+                success(res) {
+                    if (res.code) {
+                        post("appletLogin", {
+                            invite,
+                            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.shopInfo = app.globalData.shopInfo;
+                                    that.showAuth = true;
+                                    // }, 1000);
+                                }
+                            }
+                        });
+                    }
+                },
+            });
+            // #endif
+        },
+        onauthGetTelSuccess(da) {
+            this.showAuth = false;
+            post("getMobile", {
+                unid: this.unid,
+                ...da.detail
             }).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.shopInfo = app.globalData.shopInfo;
-                    that.showAuth = true;
-                  // }, 1000);
+                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;
                 }
-              }
             });
-          }
         },
-      });
-      // #endif
-    },
-    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;
+    onShareAppMessage: function() {
+        let userinfo = uni.getStorageSync("userinfo");
+        var path = "/pages/product/p_details?agentId=1" + '&id=' + this.goodsDa.id + '&type=' + this.goodsDa.type;
+        if (userinfo.invite) {
+            path = "/pages/product/p_details?invite=" + userinfo.invite + '&id=' + this.goodsDa.id + '&type=' + this.goodsDa.type;
         }
-      });
+        var title = `让数字经济赋能美好生活!`;
+        return {
+            title: title,
+            path: path,
+        };
     },
-  },
-  onShareAppMessage: function () {
-    let userinfo = uni.getStorageSync("userinfo");
-    var path = "/pages/product/p_details?agentId=1" + '&id=' + this.goodsDa.id + '&type=' + this.goodsDa.type;
-    if (userinfo.invite) {
-      path = "/pages/product/p_details?invite=" + userinfo.invite + '&id=' + this.goodsDa.id + '&type=' + this.goodsDa.type;
-    }
-    var title = `让数字经济赋能美好生活!`;
-    return {
-      title: title,
-      path: path,
-    };
-  },
 };
 </script>
-
 <style lang="scss">
 // 页面配置
 page {
-  background: #f5f5f5;
+    background: #f5f5f5;
 }
+
 .container {
-  padding-bottom: 90rpx;
+    padding-bottom: 90rpx;
 }
+
 // 页面配置-end
 
 // 价格信息栏
 .price_span {
-  width: 283rpx;
-  height: 100%;
-  position: relative;
+    width: 283rpx;
+    height: 100%;
+    position: relative;
 }
+
 .price text {
-  font-size: 24rpx;
-  color: #fff;
-  font-family: "SourceHanSansCN-Medium";
+    font-size: 24rpx;
+    color: #fff;
+    font-family: "SourceHanSansCN-Medium";
 }
+
 .price_info {
-  background: #ff6d44;
-  height: 92rpx;
-  width: 100%;
-  box-sizing: border-box;
+    background: #ff6d44;
+    height: 92rpx;
+    width: 100%;
+    box-sizing: border-box;
 }
+
 .price {
-  font-size: 38rpx;
-  color: #fff;
-  font-family: "SourceHanSansCN-Medium";
-  margin-left: 20rpx;
+    font-size: 38rpx;
+    color: #fff;
+    font-family: "SourceHanSansCN-Medium";
+    margin-left: 20rpx;
 }
+
 .span_conten {
-  width: calc(283rpx - 46rpx);
-  height: 100%;
-  background: #ffcabb;
-  position: relative;
-  font-size: 34rpx;
-  font-family: "SourceHanSansCN-Medium";
-  color: #682918;
+    width: calc(283rpx - 46rpx);
+    height: 100%;
+    background: #ffcabb;
+    position: relative;
+    font-size: 34rpx;
+    font-family: "SourceHanSansCN-Medium";
+    color: #682918;
 }
+
 .triangle {
-  width: 0px;
-  height: 0px;
-  border-top: 92rpx solid rgba(0, 0, 0, 0);
-  border-right: 92rpx solid rgba(0, 0, 0, 0);
-  border-bottom: 92rpx solid #ffcabb;
-  border-left: 92rpx solid rgba(0, 0, 0, 0);
-  transform: translate(-46rpx, -92rpx);
-  position: absolute;
-  top: 0;
-  left: 0;
+    width: 0px;
+    height: 0px;
+    border-top: 92rpx solid rgba(0, 0, 0, 0);
+    border-right: 92rpx solid rgba(0, 0, 0, 0);
+    border-bottom: 92rpx solid #ffcabb;
+    border-left: 92rpx solid rgba(0, 0, 0, 0);
+    transform: translate(-46rpx, -92rpx);
+    position: absolute;
+    top: 0;
+    left: 0;
 }
+
 .samll {
-  font-size: 28rpx;
-  max-width: calc(100% - 360rpx);
-  line-height: 1.3;
-  text-align: justify;
+    font-size: 28rpx;
+    max-width: calc(100% - 360rpx);
+    line-height: 1.3;
+    text-align: justify;
 }
+
 // 价格信息栏-end
 
 // 标题信息栏
 .goods_subName {
-  width: 100%;
-  overflow: hidden;
-  font-size: 22rpx;
-  color: #787878;
+    width: 100%;
+    overflow: hidden;
+    font-size: 22rpx;
+    color: #787878;
 }
+
 .title_info {
-  width: 100%;
-  overflow: hidden;
-  background: #ffffff;
-  padding: 20rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    background: #ffffff;
+    padding: 20rpx;
+    box-sizing: border-box;
 }
+
 .goods_name {
-  width: 100%;
-  overflow: hidden;
-  font-size: 32rpx;
-  color: #1b1b1b;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  margin-bottom: 20rpx;
+    width: 100%;
+    overflow: hidden;
+    font-size: 32rpx;
+    color: #1b1b1b;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    margin-bottom: 20rpx;
 }
+
 // 标题信息栏-end
 
 // 产品简介
 .brief {
-  width: 100%;
-  overflow: hidden;
-  background-color: #fff;
+    width: 100%;
+    overflow: hidden;
+    background-color: #fff;
 }
+
 .brief_con {
-  width: 100%;
-  overflow: hidden;
-  padding: 20rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    padding: 20rpx;
+    box-sizing: border-box;
 }
+
 .brief_title {
-  width: 100%;
-  overflow: hidden;
-  font-size: 26rpx;
-  color: #1b1b1b;
-  padding: 0 20rpx;
-  box-sizing: border-box;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
-  height: 74rpx;
+    width: 100%;
+    overflow: hidden;
+    font-size: 26rpx;
+    color: #1b1b1b;
+    padding: 0 20rpx;
+    box-sizing: border-box;
+    border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+    height: 74rpx;
 }
+
 // 产品简介-end
 
 // 底部导航组件
 .option {
-  position: fixed;
-  width: 100%;
-  overflow: hidden;
-  left: 0;
-  bottom: 0;
+    position: fixed;
+    width: 100%;
+    overflow: hidden;
+    left: 0;
+    bottom: 0;
 }
+
 // 底部导航组件-end
 
 // 购买或加入购物车弹窗
 .option_box text {
-  color: #2db389;
+    color: #2db389;
 }
+
 .goods_raido {
-  margin-right: 180rpx;
+    margin-right: 180rpx;
 }
+
 .close_img {
-  width: 36rpx;
-  height: 36rpx;
+    width: 36rpx;
+    height: 36rpx;
 }
+
 .option_box {
-  font-size: 26rpx;
-  margin-top: 80rpx;
+    font-size: 26rpx;
+    margin-top: 80rpx;
 }
+
 .goods_raido:nth-last-child(1) {
-  margin-right: 0;
+    margin-right: 0;
 }
+
 .num_con {
-  width: 100%;
-  overflow: hidden;
-  padding-bottom: 3rpx;
+    width: 100%;
+    overflow: hidden;
+    padding-bottom: 3rpx;
 }
+
 .goods_option {
-  width: 100%;
-  overflow: hidden;
-  padding-top: 50rpx;
+    width: 100%;
+    overflow: hidden;
+    padding-top: 50rpx;
 }
+
 .close_con {
-  width: 100%;
-  overflow: hidden;
-  margin-bottom: 35rpx;
+    width: 100%;
+    overflow: hidden;
+    margin-bottom: 35rpx;
 }
+
 .raido_text {
-  font-size: 26rpx;
-  color: #545454;
-  margin-left: 30rpx;
+    font-size: 26rpx;
+    color: #545454;
+    margin-left: 30rpx;
 }
+
 .goods_con {
-  width: calc(100% - 202rpx - 30rpx);
-  overflow: hidden;
+    width: calc(100% - 202rpx - 30rpx);
+    overflow: hidden;
 }
+
 .goods_img {
-  width: 202rpx;
-  height: 187rpx;
-  margin-right: 30rpx;
-  border-radius: 12rpx;
+    width: 202rpx;
+    height: 187rpx;
+    margin-right: 30rpx;
+    border-radius: 12rpx;
 }
+
 .confim {
-  width: 100%;
-  height: 80rpx;
-  border-radius: 40rpx;
-  background: #2db389;
-  color: #fff;
-  font-size: 26rpx;
-  margin-top: 44rpx;
+    width: 100%;
+    height: 80rpx;
+    border-radius: 40rpx;
+    background: #2db389;
+    color: #fff;
+    font-size: 26rpx;
+    margin-top: 44rpx;
 }
+
 .shopping {
-  width: 100%;
-  overflow: hidden;
-  padding: 20rpx;
-  box-sizing: border-box;
-  border-radius: 30rpx 30rpx 0 0;
-  background: #fff;
+    width: 100%;
+    overflow: hidden;
+    padding: 20rpx;
+    box-sizing: border-box;
+    border-radius: 30rpx 30rpx 0 0;
+    background: #fff;
 }
+
 .goods_info {
-  width: 100%;
-  overflow: hidden;
-  align-items: inherit;
-  padding-bottom: 48rpx;
-  border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
+    width: 100%;
+    overflow: hidden;
+    align-items: inherit;
+    padding-bottom: 48rpx;
+    border-bottom: 3rpx solid rgba(0, 0, 0, 0.12);
 }
+
 .shop_names {
-  width: 100%;
-  overflow: hidden;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  color: #1b1b1b;
-  font-size: 32rpx;
+    width: 100%;
+    overflow: hidden;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    color: #1b1b1b;
+    font-size: 32rpx;
 }
+
 .goods_msg {
-  width: 100%;
-  overflow: hidden;
-  font-size: 28rpx;
-  color: #18bb88;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: 500;
+    width: 100%;
+    overflow: hidden;
+    font-size: 28rpx;
+    color: #18bb88;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
 }
+
 .raido_img {
-  width: 39rpx;
-  height: 35rpx;
-  background: url(~@/static/img/weixuanzhong.png);
-  background-repeat: no-repeat;
-  background-size: 35rpx 35rpx;
-  background-position: center center;
+    width: 39rpx;
+    height: 35rpx;
+    background: url(~@/static/img/weixuanzhong.png);
+    background-repeat: no-repeat;
+    background-size: 35rpx 35rpx;
+    background-position: center center;
 }
 
 .raido_box {
-  background: url(~@/static/img/consent.png);
-  background-repeat: no-repeat;
-  background-size: 39rpx 35rpx;
-  background-position: center center;
+    background: url(~@/static/img/consent.png);
+    background-repeat: no-repeat;
+    background-size: 39rpx 35rpx;
+    background-position: center center;
 }
+
 // 购买或加入购物车弹窗-end
-</style>
+</style>

+ 2 - 2
src/pages/product/productRetail.vue

@@ -20,7 +20,7 @@
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import uniPopup from '@/components/uni-popup/uni-popup.vue'
 export default {
     components: { uniPopup },
@@ -53,7 +53,7 @@ export default {
             post("goods/goodsList", data).then(res => {
                 if (res.code === 0) {
                     let obj = res.data.data
-                    if(page == 1) that.goods = []
+                    if (page == 1) that.goods = []
                     if (obj.length > 0) {
                         obj.forEach(e => {
                             that.goods.push(e)

+ 123 - 130
src/pages/product/productTeaBaby.vue

@@ -1,178 +1,171 @@
 <template>
-  <view class="container">
-    <!-- 批发专区 -->
-    <view
-      class="who_list flex_r"
-      v-for="(item, index) in who_list"
-      :key="index"
-      @tap="NavToGoodsDetail(item.id)"
-    >
-      <image class="list_img" :src="item.original_img"></image>
-      <view class="list_info flex_c flex_jb">
-        <view class="info_name">{{ item.goods_name }}</view>
-        <view class="info_msg">
-          <view></view>
-          <span v-if="Number(item.price) != 0">{{ item.price }}元</span>
-          <span v-if="Number(item.cha_bao_price) != 0 && Number(item.price) != 0">+</span>
-          <span v-if="Number(item.cha_bao_price) != 0">{{ item.cha_bao_price }}茶宝</span>
+    <view class="container">
+        <!-- 批发专区 -->
+        <view class="who_list flex_r" v-for="(item, index) in who_list" :key="index" @tap="NavToGoodsDetail(item.id)">
+            <image class="list_img" :src="item.original_img"></image>
+            <view class="list_info flex_c flex_jb">
+                <view class="info_name">{{ item.goods_name }}</view>
+                <view class="info_msg">
+                    <view></view>
+                    <span v-if="Number(item.price) != 0">{{ item.price }}元</span>
+                    <span v-if="Number(item.cha_bao_price) != 0 && Number(item.price) != 0">+</span>
+                    <span v-if="Number(item.cha_bao_price) != 0">{{ item.cha_bao_price }}茶宝</span>
+                </view>
+                <view class="info_btn_con flex_r flex_je">
+                    <view class="info_btn flex_r flex_ac flex_jc">兑换</view>
+                </view>
+            </view>
         </view>
-        <view class="info_btn_con flex_r flex_je">
-          <view class="info_btn flex_r flex_ac flex_jc">兑换</view>
-        </view>
-      </view>
     </view>
-  </view>
 </template>
 <script>
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
-  data() {
-    return {
-      who_list: [], // 茶宝兑换商品列表
-      type: "",
-    };
-  },
-  onLoad(e) {
-    this.type = e.type;
-  },
-  onShow() {
-    page = 1;
-    this.who_list = [];
-    this.loadData();
-  },
-  methods: {
-    loadData() {
-      let that = this;
-      uni.showLoading({ mask: true });
-      let data = {
-        page: page,
-        type: this.type,
-      };
-      post("goods/goodsList", data).then((res) => {
-        uni.hideLoading();
-        if (res.code === 0) {
-          let obj = res.data.data;
-          if (page == 1) that.who_list = [];
-          if (obj.length > 0) {
-            obj.forEach((e) => {
-              that.who_list.push(e);
+    data() {
+        return {
+            who_list: [], // 茶宝兑换商品列表
+            type: "",
+        };
+    },
+    onLoad(e) {
+        this.type = e.type;
+    },
+    onShow() {
+        page = 1;
+        this.who_list = [];
+        this.loadData();
+    },
+    methods: {
+        loadData() {
+            let that = this;
+            uni.showLoading({ mask: true });
+            let data = {
+                page: page,
+                type: this.type,
+            };
+            post("goods/goodsList", data).then((res) => {
+                uni.hideLoading();
+                if (res.code === 0) {
+                    let obj = res.data.data;
+                    if (page == 1) that.who_list = [];
+                    if (obj.length > 0) {
+                        obj.forEach((e) => {
+                            that.who_list.push(e);
+                        });
+                    } else {
+                        page = -1;
+                        appEv.errTips("暂无更多");
+                    }
+                } else {
+                    page = -1;
+                    appEv.errTips("暂无更多");
+                }
+            });
+        },
+        // 跳转到商品详情页
+        NavToGoodsDetail: function(id) {
+            uni.navigateTo({
+                url: "/pages/product/p_details?id=" + id + "&type=" + this.type,
             });
-          } else {
-            page = -1;
-            appEv.errTips("暂无更多");
-          }
-        } else {
-          page = -1;
-          appEv.errTips("暂无更多");
+        },
+    },
+
+    onShareAppMessage: function() {
+        let userinfo = uni.getStorageSync("userinfo");
+        var path = "/pages/product/productWholesale?agentId=1";
+        if (userinfo.user_id) {
+            path = "/pages/product/productWholesale?agentId=" + userinfo.user_id;
         }
-      });
+        var title = `让数字经济赋能美好生活!`;
+        return {
+            title: title,
+            path: path,
+        };
     },
-    // 跳转到商品详情页
-    NavToGoodsDetail: function (id) {
-      uni.navigateTo({
-        url: "/pages/product/p_details?id=" + id + "&type=" + this.type,
-      });
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+        if (page != -1) {
+            var that = this;
+            setTimeout(function() {
+                ++page;
+                that.loadData();
+            }, 800);
+        }
     },
-  },
-
-  onShareAppMessage: function () {
-    let userinfo = uni.getStorageSync("userinfo");
-    var path = "/pages/product/productWholesale?agentId=1";
-    if (userinfo.user_id) {
-      path = "/pages/product/productWholesale?agentId=" + userinfo.user_id;
-    }
-    var title = `让数字经济赋能美好生活!`;
-    return {
-      title: title,
-      path: path,
-    };
-  },
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-    if (page != -1) {
-      var that = this;
-      setTimeout(function () {
-        ++page;
-        that.loadData();
-      }, 800);
-    }
-  },
 };
 </script>
 <style lang="scss">
 // 页面配置
 page {
-  background: #f5f5f5;
+    background: #f5f5f5;
 }
 
 .container {
-  padding: 18rpx 30rpx 0;
-  box-sizing: border-box;
+    padding: 18rpx 30rpx 0;
+    box-sizing: border-box;
 }
 
 // 页面配置-end
 
 // 批发商品列表
 .info_btn_con {
-  width: 100%;
-  overflow: hidden;
+    width: 100%;
+    overflow: hidden;
 }
 
 .list_info {
-  width: calc(100% - 200rpx);
-  overflow: hidden;
+    width: calc(100% - 200rpx);
+    overflow: hidden;
 }
 
 .list_img {
-  width: 200rpx;
-  height:180rpx;
-  margin-right: 35rpx;
-  border-radius: 12rpx;
+    width: 200rpx;
+    height: 180rpx;
+    margin-right: 35rpx;
+    border-radius: 12rpx;
 }
 
 .info_btn {
-  width: 134rpx;
-  height: 50rpx;
-  background: #2db48a;
-  font-size: 30rpx;
-  color: #fff;
-  border-radius: 12rpx;
+    width: 134rpx;
+    height: 50rpx;
+    background: #2db48a;
+    font-size: 30rpx;
+    color: #fff;
+    border-radius: 12rpx;
 }
 
 .info_msg {
-  width: 100%;
-  overflow: hidden;
-  font-size: 28rpx;
-  color: #18bb88;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: 500;
+    width: 100%;
+    overflow: hidden;
+    font-size: 28rpx;
+    color: #18bb88;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
 }
 
 .info_name {
-  width: 100%;
-  overflow: hidden;
-  font-size: 34rpx;
-  color: #1b1b1b;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
+    width: 100%;
+    overflow: hidden;
+    font-size: 34rpx;
+    color: #1b1b1b;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
 }
 
 .who_list {
-  width: 100%;
-  overflow: hidden;
-  background: #fff;
-  padding: 20rpx 16rpx;
-  box-sizing: border-box;
-  border-radius: 12rpx;
-  margin-bottom: 18rpx;
-  align-items: initial;
+    width: 100%;
+    overflow: hidden;
+    background: #fff;
+    padding: 20rpx 16rpx;
+    box-sizing: border-box;
+    border-radius: 12rpx;
+    margin-bottom: 18rpx;
+    align-items: initial;
 }
 
 // 批发商品列表-end

+ 4 - 6
src/pages/product/productWholesale.vue

@@ -18,9 +18,7 @@
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
     data() {
         return {
@@ -48,7 +46,7 @@ export default {
                 uni.hideLoading()
                 if (res.code === 0) {
                     let obj = res.data.data
-                    if(page == 1) that.who_list = []
+                    if (page == 1) that.who_list = []
                     if (obj.length > 0) {
                         obj.forEach(e => {
                             that.who_list.push(e)
@@ -70,7 +68,7 @@ export default {
             })
         }
     },
-    
+
     onShareAppMessage: function() {
         let userinfo = uni.getStorageSync('userinfo');
         var path = '/pages/product/productWholesale?agentId=1';
@@ -123,7 +121,7 @@ page {
 
 .list_img {
     width: 200rpx;
-    height:180rpx;
+    height: 180rpx;
     margin-right: 35rpx;
     border-radius: 12rpx;
 }

+ 0 - 4
src/pages/protocol/index.vue

@@ -17,10 +17,6 @@
 </template>
 
 <script>
-// let app=getApp();
-// let reqApi = new ReqApi();
-// var appEv = app.$vm.$options;
-// import { ReqApi } from "@/utils/reqTools.js";
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
 import { get, post } from "@/request/api.js";
 	export default {

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

@@ -65,7 +65,7 @@ let app = getApp();
 var appEv = app.$vm.$options;
 import uniPopup from '@/components/uni-popup/uni-popup'
 import goodsLista from "@/components/goodsLista"
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
     components: { 
         uniPopup,

+ 1 - 3
src/pages/speed-up/index.vue

@@ -69,9 +69,7 @@ let tim
 let page = 1;
 let app=getApp();
 var appEv = app.$vm.$options;
-import { get, post, u_post } from "@/request/api.js";
-// let reqApi = new ReqApi();
-// import { ReqApi } from "@/utils/reqTools.js";
+import { get, post } from "@/request/api.js";
 import cmdProgress from "@/components/cmd-progress/cmd-progress.vue"
 	export default {
 		components: {cmdProgress},

+ 1 - 1
src/pages/szw-order-details/index.vue

@@ -84,7 +84,7 @@
 <script>
 // var toPayOpre = new ToPayOpre();
 var utils = require("@/utils/utils.js");
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 var app = getApp();
 var appEv = app.$vm.$options;
 export default {

+ 1 - 1
src/pages/szw-order-list/index.vue

@@ -53,7 +53,7 @@ var page = 1;
 var app = getApp();
 var appEv = app.$vm.$options;
 import notGoods from "@/components/not-goods/index";
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import { ToPayOpre } from "@/utils/reqTools.js";
 var toPayOpre = new ToPayOpre();
 export default {

+ 1 - 4
src/pages/tea-list/index.vue

@@ -37,11 +37,8 @@
 <script>
 let page = 1;
 let app = getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
-import uniCopy from "../../utils/copy";
-// import { ReqApi } from "@/utils/reqTools.js";
-// import uniCopy from "@/js_sdk/xb-copy/uni-copy.js";
+import uniCopy from "@/utils/copy";
 import { post } from "@/request/api.js";
 export default {
   data() {

+ 0 - 2
src/pages/tea-rule/index.vue

@@ -8,11 +8,9 @@
 
 <script>
 let app=getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { post } from "@/request/api.js";
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'
-// import { ReqApi } from "@/utils/reqTools.js";
 	export default {
 		data() {
 			return {

+ 365 - 391
src/pages/to-pay-list/index.vue

@@ -1,529 +1,503 @@
 <template>
-  <view class="container">
-    <!-- 收货地址 -->
-    <view class="address" v-if="Data.is_sell != 1">
-      <block
-        v-if="
+    <view class="container">
+        <!-- 收货地址 -->
+        <view class="address" v-if="Data.is_sell != 1">
+            <block v-if="
           DefaultAddress != '' &&
           DefaultAddress.name != '' &&
           DefaultAddress.name != undefined
-        "
-      >
-        <view class="add_head flex_r flex_ac flex_jb">
-          <view class="user_info flex_r flex_ac">
-            <view class="user_name">{{ DefaultAddress.name }}</view>
-            <view class="user_phone">{{ DefaultAddress.mobile }}</view>
-          </view>
-          <view class="set_address flex_r flex_ac" @tap="chooseWXaddress">
-            <image
-              class="set_img"
-              src="/static/img/setAddress.png"
-              mode=""
-            ></image>
-            <view class="set_text">修改</view>
-          </view>
+        ">
+                <view class="add_head flex_r flex_ac flex_jb">
+                    <view class="user_info flex_r flex_ac">
+                        <view class="user_name">{{ DefaultAddress.name }}</view>
+                        <view class="user_phone">{{ DefaultAddress.mobile }}</view>
+                    </view>
+                    <view class="set_address flex_r flex_ac" @tap="chooseWXaddress">
+                        <image class="set_img" src="/static/img/setAddress.png" mode=""></image>
+                        <view class="set_text">修改</view>
+                    </view>
+                </view>
+                <view class="add_name mar_t20">{{ DefaultAddress.address }}</view>
+            </block>
+            <block v-else>
+                <view class="add_address flex_c flex_ac flex_jc" @tap="chooseWXaddress('add')">
+                    <image class="add_icon" src="/static/img/add.png" mode=""></image>
+                    <view class="add_text">添加收货地址</view>
+                </view>
+            </block>
         </view>
-        <view class="add_name mar_t20">{{ DefaultAddress.address }}</view>
-      </block>
-      <block v-else>
-        <view
-          class="add_address flex_c flex_ac flex_jc"
-          @tap="chooseWXaddress('add')"
-        >
-          <image class="add_icon" src="/static/img/add.png" mode=""></image>
-          <view class="add_text">添加收货地址</view>
+        <!-- 收货地址-end -->
+        <!-- 商品信息 -->
+        <view class="goods_info mar_t20">
+            <view class="info_type">{{ modularName }}</view>
+            <view class="goods flex_r">
+                <image class="goods_img" :src="goodsInfo.original_img" mode=""></image>
+                <view class="goods_con flex_c flex_jc flex_jb">
+                    <view class="goods_name ellipsis2">{{ goodsInfo.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>
+                    </view>
+                </view>
+            </view>
         </view>
-      </block>
-    </view>
-    <!-- 收货地址-end -->
-    <!-- 商品信息 -->
-    <view class="goods_info mar_t20">
-      <view class="info_type">{{ modularName }}</view>
-      <view class="goods flex_r">
-        <image class="goods_img" :src="goodsInfo.original_img" mode=""></image>
-        <view class="goods_con flex_c flex_jc flex_jb">
-          <view class="goods_name ellipsis2">{{ goodsInfo.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>
-          </view>
-        </view>
-      </view>
-    </view>
-    <!-- 商品信息-end -->
-    <!-- 订单信息 -->
-    <view class="order mar_t20">
-      <view class="order_list flex_r flex_ac flex_jb">
-        <view class="list_name">数量</view>
-        <view class="list_con">{{ Data.num }}</view>
-      </view>
-      <view class="order_list flex_r flex_ac flex_jb" v-if="Data.is_sell != 1">
-        <view class="flex_r flex_ac">
-          <view class="list_name">运费</view>
-          <view class="list_con p_color">({{ freight }}元/每套)</view>
+        <!-- 商品信息-end -->
+        <!-- 订单信息 -->
+        <view class="order mar_t20">
+            <view class="order_list flex_r flex_ac flex_jb">
+                <view class="list_name">数量</view>
+                <view class="list_con">{{ Data.num }}</view>
+            </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.is_sell != 1">
+                <view class="flex_r flex_ac">
+                    <view class="list_name">运费</view>
+                    <view class="list_con p_color">({{ freight }}元/每套)</view>
+                </view>
+                <view class="list_con">¥{{ freight * Data.num }}</view>
+            </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2 || Data.type == 5">
+                <view class="flex_r flex_ac">
+                    <view class="list_name">茶宝</view>
+                    <view class="list_con p_color">(可用{{ userinfo.cha_bao }})</view>
+                </view>
+                <view class="list_con" v-if="Data.type != 5">{{ goodsInfo.treasure_price }} 茶宝</view>
+                <view class="list_con" v-else>{{ goodsInfo.cha_bao }} 茶宝</view>
+            </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2">
+                <view class="flex_r flex_ac">
+                    <view class="list_name">批发积分</view>
+                    <view class="list_con p_color">(可用{{ userinfo.integral }})</view>
+                </view>
+                <view class="list_con">{{ goodsInfo.trade_num * Data.num }} 批发积分</view>
+            </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 5">
+                <view class="list_name">商品金额</view>
+                <view class="list_con">¥{{
+                    (Data.type == 2 ? goodsInfo.trade_price : goodsInfo.cost_price) *
+                    Data.num || 0
+                    }}</view>
+            </view>
+            <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 4 && Data.type != 5">
+                <view class="list_name">可用余额</view>
+                <view class="list_con p_color">¥{{ userinfo.user_money }}</view>
+            </view>
         </view>
-        <view class="list_con">¥{{ freight * Data.num }}</view>
-      </view>
-      <view
-        class="order_list flex_r flex_ac flex_jb"
-        v-if="Data.type == 2 || Data.type == 5"
-      >
-        <view class="flex_r flex_ac">
-          <view class="list_name">茶宝</view>
-          <view class="list_con p_color">(可用{{ userinfo.cha_bao }})</view>
+        <!-- 订单信息-end -->
+        <!-- 底部操作栏 -->
+        <view class="bar flex_r flex_ac flex_jb">
+            <view class="bar_info flex_r flex_ac">待支付<text>¥{{ obligation }}</text></view>
+            <view class="pay_btn flex_r flex_ac flex_jc" @tap="payment">立即支付</view>
         </view>
-        <view class="list_con" v-if="Data.type != 5"
-          >{{ goodsInfo.treasure_price }} 茶宝</view
-        >
-        <view class="list_con" v-else>{{ goodsInfo.cha_bao }} 茶宝</view>
-      </view>
-      <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2">
-        <view class="flex_r flex_ac">
-          <view class="list_name">批发积分</view>
-          <view class="list_con p_color">(可用{{ userinfo.integral }})</view>
-        </view>
-        <view class="list_con"
-          >{{ goodsInfo.trade_num * Data.num }} 批发积分</view
-        >
-      </view>
-      <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 5">
-        <view class="list_name">商品金额</view>
-        <view class="list_con"
-          >¥{{
-            (Data.type == 2 ? goodsInfo.trade_price : goodsInfo.cost_price) *
-              Data.num || 0
-          }}</view
-        >
-      </view>
-      <view
-        class="order_list flex_r flex_ac flex_jb"
-        v-if="Data.type != 4 && Data.type != 5"
-      >
-        <view class="list_name">可用余额</view>
-        <view class="list_con p_color">¥{{ userinfo.user_money }}</view>
-      </view>
-    </view>
-    <!-- 订单信息-end -->
-    <!-- 底部操作栏 -->
-    <view class="bar flex_r flex_ac flex_jb">
-      <view class="bar_info flex_r flex_ac"
-        >待支付<text>¥{{ obligation }}</text></view
-      >
-      <view class="pay_btn flex_r flex_ac flex_jc" @tap="payment"
-        >立即支付</view
-      >
+        <!-- 底部操作栏-end -->
+        <!-- 收获地址弹窗 -->
+        <userAddress ref="userAddress" @addressConfirm="loadDa" />
     </view>
-    <!-- 底部操作栏-end -->
-    <!-- 收获地址弹窗 -->
-    <userAddress ref="userAddress" @addressConfirm="loadDa" />
-  </view>
 </template>
 <script>
 let page = 1;
 let app = getApp();
 var appEv = app.$vm.$options;
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import { ToPayOpre } from "@/utils/reqTools.js";
 let toPayOpre = new ToPayOpre();
 import userAddress from "pages/xghc-addrress/userAddress";
 export default {
-  data() {
-    return {
-      Data: {},
-      goodsInfo: "", // 商品信息
-      modularName: "", // 商品类型
-      DefaultAddress: "", // 用户默认地址
-      basicsInfo: "", // 订单信息
-
-      freight: 0, //运费
-      userinfo: {},
-      obligation: 0, //待支付
-    };
-  },
-  components: {
-    userAddress,
-  },
-  onLoad(e) {
-    this.Data = e;
-    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) {
-      post("goods/goodsDetail", da).then((res) => {
-        if (res.code === 0) {
-          this.goodsInfo = res.data.data;
-          post("goods/freight", { type: da.type }).then((res) => {
-            if (res.code === 0) this.freight = res.data.freight;
-
-            // 计算待支付
-            let p =
-              this.Data.type == 2
-                ? this.goodsInfo.trade_price
-                : this.goodsInfo.cost_price; //商品单价
-            let y = this.Data.is_sell == 1 ? 0 : this.freight; // 运费   寄售的话退运费为0
-            let a = (p * this.Data.num + y * this.Data.num) * 100; //商品总价
-            let b = (a - this.userinfo.user_money * 100) / 100; //待支付金额
-            if (this.Data.type == 4) this.obligation = a / 100;
-            else if (this.Data.type == 5) {
-              this.obligation = a / 100;
-            } else this.obligation = b > 0 ? b : 0;
-          });
-        }
-      });
+    data() {
+        return {
+            Data: {},
+            goodsInfo: "", // 商品信息
+            modularName: "", // 商品类型
+            DefaultAddress: "", // 用户默认地址
+            basicsInfo: "", // 订单信息
+
+            freight: 0, //运费
+            userinfo: {},
+            obligation: 0, //待支付
+        };
     },
-    // 获取用户地址
-    loadAddress() {
-      post("user/addressList").then((res) => {
-        if (res.code === 0) {
-          let da = res.data.data;
-          for (const i of da) {
-            if (i.status == 1) {
-              this.DefaultAddress = i;
-              break;
-            } else this.DefaultAddress = da[0];
-          }
-          // #ifdef  MP-WEIXIN
-          if (!da.length && this.Data.is_sell != 1) this.getwexinAddress();
-          // #endif
-        }
-      });
+    components: {
+        userAddress,
     },
-    //获取微信的收货地址
-    getwexinAddress() {
-      uni.chooseAddress({
-        success(res) {
-          if (res.errMsg == "chooseAddress:ok") {
-            let data = {
-              address:
-                res.provinceName +
-                res.cityName +
-                res.countyName +
-                res.detailInfo,
-              mobile: res.telNumber,
-              name: res.userName,
-              is_default: 0,
-            };
-            post("user/addAddress", data).then((res) => {
-              if (res.code === 0) {
-                appEv.errTips(res.msg);
-                this.loadAddress();
-              }
+    onLoad(e) {
+        this.Data = e;
+        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) {
+            post("goods/goodsDetail", da).then((res) => {
+                if (res.code === 0) {
+                    this.goodsInfo = res.data.data;
+                    post("goods/freight", { type: da.type }).then((res) => {
+                        if (res.code === 0) this.freight = res.data.freight;
+
+                        // 计算待支付
+                        let p =
+                            this.Data.type == 2 ?
+                            this.goodsInfo.trade_price :
+                            this.goodsInfo.cost_price; //商品单价
+                        let y = this.Data.is_sell == 1 ? 0 : this.freight; // 运费   寄售的话退运费为0
+                        let a = (p * this.Data.num + y * this.Data.num) * 100; //商品总价
+                        let b = (a - this.userinfo.user_money * 100) / 100; //待支付金额
+                        if (this.Data.type == 4) this.obligation = a / 100;
+                        else if (this.Data.type == 5) {
+                            this.obligation = a / 100;
+                        } else this.obligation = b > 0 ? b : 0;
+                    });
+                }
+            });
+        },
+        // 获取用户地址
+        loadAddress() {
+            post("user/addressList").then((res) => {
+                if (res.code === 0) {
+                    let da = res.data.data;
+                    for (const i of da) {
+                        if (i.status == 1) {
+                            this.DefaultAddress = i;
+                            break;
+                        } else this.DefaultAddress = da[0];
+                    }
+                    // #ifdef  MP-WEIXIN
+                    if (!da.length && this.Data.is_sell != 1) this.getwexinAddress();
+                    // #endif
+                }
+            });
+        },
+        //获取微信的收货地址
+        getwexinAddress() {
+            uni.chooseAddress({
+                success(res) {
+                    if (res.errMsg == "chooseAddress:ok") {
+                        let data = {
+                            address: res.provinceName +
+                                res.cityName +
+                                res.countyName +
+                                res.detailInfo,
+                            mobile: res.telNumber,
+                            name: res.userName,
+                            is_default: 0,
+                        };
+                        post("user/addAddress", data).then((res) => {
+                            if (res.code === 0) {
+                                appEv.errTips(res.msg);
+                                this.loadAddress();
+                            }
+                        });
+                    }
+                },
             });
-          }
         },
-      });
-    },
 
-    chooseWXaddress(va) {
-      // this.getwexinAddress()
-      let a = va != "add" ? this.DefaultAddress.id : "add";
-      this.$refs.userAddress.open(a);
+        chooseWXaddress(va) {
+            // this.getwexinAddress()
+            let a = va != "add" ? this.DefaultAddress.id : "add";
+            this.$refs.userAddress.open(a);
 
-      // this.goto("/pages/xghc-addrress/userAddress");
-    },
-    // 支付
-    payment() {
-      // #ifdef  H5
-      let type = "H5";
-      // #endif
-      // #ifdef  APP
-      let type = "app";
-      // #endif
-      // #ifdef  MP-WEIXIN
-      let type = "jsapi";
-      // #endif
-
-      if (!this.DefaultAddress.id) {
-        appEv.errTips("请选择地址");
-        return;
-      }
-      post("goods/submitOrder", {
-        ...this.Data,
-        address_id: this.DefaultAddress.id,
-        trade_type: type,
-      }).then((res) => {
-        if (res.code === 0) {
-          if (res.data.length !== 0) {
-            toPayOpre.toPay(res.data, (rea) => {
-              if (!rea) {
-                // 支付成功
-                appEv.errTips("支付成功");
-                if (this.Data.type == 2 && this.Data.is_sell == 1) {
-                    setTimeout(() => {
-                    this.goto("/pages/account/consignment");
-                  }, 1500);
-                } else {
-                  setTimeout(() => {
-                    this.goto("/pages/szw-order-list/index");
-                  }, 1500);
+            // this.goto("/pages/xghc-addrress/userAddress");
+        },
+        // 支付
+        payment() {
+            // #ifdef  H5
+            let type = "H5";
+            // #endif
+            // #ifdef  APP
+            let type = "app";
+            // #endif
+            // #ifdef  MP-WEIXIN
+            let type = "jsapi";
+            // #endif
+
+            if (!this.DefaultAddress.id) {
+                appEv.errTips("请选择地址");
+                return;
+            }
+            post("goods/submitOrder", {
+                ...this.Data,
+                address_id: this.DefaultAddress.id,
+                trade_type: type,
+            }).then((res) => {
+                if (res.code === 0) {
+                    if (res.data.length !== 0) {
+                        toPayOpre.toPay(res.data, (rea) => {
+                            if (!rea) {
+                                // 支付成功
+                                appEv.errTips("支付成功");
+                                if (this.Data.type == 2 && this.Data.is_sell == 1) {
+                                    setTimeout(() => {
+                                        this.goto("/pages/account/consignment");
+                                    }, 1500);
+                                } else {
+                                    setTimeout(() => {
+                                        this.goto("/pages/szw-order-list/index");
+                                    }, 1500);
+                                }
+                            } else {
+                                // 支付失败
+                                appEv.errTips("支付已取消");
+                            }
+                        });
+                    } else {
+                        appEv.errTips("支付成功");
+                        setTimeout(() => {
+                            if (this.Data.is_sell != 1)
+                                this.goto("/pages/szw-order-list/index");
+                            else this.goto("/pages/account/consignment");
+                        }, 1500);
+                    }
                 }
-              } else {
-                // 支付失败
-                appEv.errTips("支付已取消");
-              }
             });
-          } else {
-            appEv.errTips("支付成功");
-            setTimeout(() => {
-              if (this.Data.is_sell != 1)
-                this.goto("/pages/szw-order-list/index");
-              else this.goto("/pages/account/consignment");
-            }, 1500);
-          }
-        }
-      });
-    },
+        },
 
-    loadDa(da) {
-      this.DefaultAddress = da;
+        loadDa(da) {
+            this.DefaultAddress = da;
+        },
     },
-  },
 };
 </script>
 <style lang="scss">
 // 页面配置
 page {
-  background: #f5f5f5;
+    background: #f5f5f5;
 }
 
 .container {
-  padding: 20rpx;
-  box-sizing: border-box;
+    padding: 20rpx;
+    box-sizing: border-box;
 }
 
 // 页面配置-end
 
 // 收货地址
 .user_phone {
-  font-size: 26rpx;
-  color: #222;
+    font-size: 26rpx;
+    color: #222;
 }
 
 .set_text {
-  font-size: 24rpx;
-  color: #868686;
+    font-size: 24rpx;
+    color: #868686;
 }
 
 .set_img {
-  width: 24rpx;
-  height: 24rpx;
-  margin-right: 9rpx;
+    width: 24rpx;
+    height: 24rpx;
+    margin-right: 9rpx;
 }
 
 .add_address {
-  width: 100%;
-  overflow: hidden;
-  height: 109rpx;
+    width: 100%;
+    overflow: hidden;
+    height: 109rpx;
 }
 
 .add_icon {
-  width: 60rpx;
-  height: 60rpx;
-  margin-bottom: 12rpx;
+    width: 60rpx;
+    height: 60rpx;
+    margin-bottom: 12rpx;
 }
 
 .user_name {
-  font-size: 32rpx;
-  color: #000;
-  margin-right: 46rpx;
+    font-size: 32rpx;
+    color: #000;
+    margin-right: 46rpx;
 }
 
 .add_name {
-  width: 448rpx;
-  overflow: hidden;
-  font-size: 24rpx;
-  color: #868686;
+    width: 448rpx;
+    overflow: hidden;
+    font-size: 24rpx;
+    color: #868686;
 }
 
 .add_text {
-  font-size: 24rpx;
-  color: #868686;
-  font-family: "SourceHanSansCN-Normal";
+    font-size: 24rpx;
+    color: #868686;
+    font-family: "SourceHanSansCN-Normal";
 }
 
 .address {
-  width: 100%;
-  overflow: hidden;
-  padding: 28rpx;
-  box-sizing: border-box;
-  background: #fff;
-  border-radius: 12rpx;
+    width: 100%;
+    overflow: hidden;
+    padding: 28rpx;
+    box-sizing: border-box;
+    background: #fff;
+    border-radius: 12rpx;
 }
 
 // 收货地址-end
 
 // 商品信息
 .goods:nth-last-child(1) {
-  margin-bottom: 0;
+    margin-bottom: 0;
 }
 
 .goods_num {
-  font-size: 26rpx;
-  color: #989898;
+    font-size: 26rpx;
+    color: #989898;
 }
 
 .goods_con {
-  width: calc(100% - 202rpx - 36rpx);
-  overflow: hidden;
+    width: calc(100% - 202rpx - 36rpx);
+    overflow: hidden;
 }
 
 .goods {
-  width: 100%;
-  overflow: hidden;
-  margin-bottom: 20rpx;
-  align-items: initial;
+    width: 100%;
+    overflow: hidden;
+    margin-bottom: 20rpx;
+    align-items: initial;
 }
 
 .goods_img {
-  width: 202rpx;
-  height: 187rpx;
-  margin-right: 36rpx;
-  border-radius: 12rpx;
+    width: 202rpx;
+    height: 187rpx;
+    margin-right: 36rpx;
+    border-radius: 12rpx;
 }
 
 .goods_name {
-  font-size: 34rpx;
-  color: #1b1b1b;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
+    font-size: 34rpx;
+    color: #1b1b1b;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
 }
 
 .goods_msg {
-  overflow: hidden;
-  font-size: 26rpx;
-  color: #18bb88;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: 500;
+    overflow: hidden;
+    font-size: 26rpx;
+    color: #18bb88;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
 }
 
 .info_type {
-  font-size: 30rpx;
-  color: #353535;
-  font-family: "SourceHanSansCN-Bold";
-  font-weight: bold;
-  margin-bottom: 43rpx;
+    font-size: 30rpx;
+    color: #353535;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    margin-bottom: 43rpx;
 }
 
 .goods_info {
-  width: 100%;
-  overflow: hidden;
-  padding: 28rpx;
-  background: #fff;
-  border-radius: 12rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    padding: 28rpx;
+    background: #fff;
+    border-radius: 12rpx;
+    box-sizing: border-box;
 }
 
 // 商品信息-end
 
 // 订单信息
 .list_name {
-  width: 112rpx;
-  text-align-last: justify;
-  font-size: 26rpx;
-  color: rgba(0, 0, 0, 0.8);
-  font-family: SourceHanSansCN-Medium;
-  font-weight: 700;
+    width: 112rpx;
+    text-align-last: justify;
+    font-size: 26rpx;
+    color: rgba(0, 0, 0, 0.8);
+    font-family: SourceHanSansCN-Medium;
+    font-weight: 700;
 }
 
 .order_list:nth-last-child(1) {
-  margin-bottom: 0;
+    margin-bottom: 0;
 }
 
 .order_list {
-  width: 100%;
-  overflow: hidden;
-  margin-bottom: 30rpx;
+    width: 100%;
+    overflow: hidden;
+    margin-bottom: 30rpx;
 }
 
 .list_con {
-  font-size: 24rpx;
-  color: #000;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: bold;
-  line-height: 1;
+    font-size: 24rpx;
+    color: #000;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: bold;
+    line-height: 1;
 }
 
 .order {
-  width: 100%;
-  overflow: hidden;
-  padding: 28rpx;
-  box-sizing: border-box;
-  background: #fff;
-  border-radius: 12rpx;
+    width: 100%;
+    overflow: hidden;
+    padding: 28rpx;
+    box-sizing: border-box;
+    background: #fff;
+    border-radius: 12rpx;
 }
 
 .list_name text {
-  font-size: 26rpx;
-  color: rgba(0, 0, 0, 0.8);
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: bold;
-  line-height: 1;
+    font-size: 26rpx;
+    color: rgba(0, 0, 0, 0.8);
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: bold;
+    line-height: 1;
 }
 
 .p_color {
-  color: #ff6d44;
+    color: #ff6d44;
 }
 
 // 订单信息-end
 
 // 底部操作栏
 .bar_info {
-  font-size: 24rpx;
-  color: #000;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: bold;
+    font-size: 24rpx;
+    color: #000;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: bold;
 }
 
 .bar_info text {
-  font-size: 30rpx;
-  color: #ff6d44;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: bold;
+    font-size: 30rpx;
+    color: #ff6d44;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: bold;
 }
 
 .pay_btn {
-  width: 187rpx;
-  height: 72rpx;
-  font-size: 30rpx;
-  font-family: "SourceHanSansCN-Medium";
-  font-weight: bold;
-  background: #2db48a;
-  border-radius: 36rpx;
-  color: #fff;
+    width: 187rpx;
+    height: 72rpx;
+    font-size: 30rpx;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: bold;
+    background: #2db48a;
+    border-radius: 36rpx;
+    color: #fff;
 }
 
 .bar {
-  width: 100%;
-  overflow: hidden;
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  background: #fff;
-  box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.15);
-  padding: 14rpx 30rpx;
-  box-sizing: border-box;
+    width: 100%;
+    overflow: hidden;
+    position: fixed;
+    bottom: 0;
+    left: 0;
+    background: #fff;
+    box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.15);
+    padding: 14rpx 30rpx;
+    box-sizing: border-box;
 }
 
 // 底部操作栏-end

+ 2 - 3
src/pages/top-up/index.vue

@@ -55,11 +55,10 @@
 
 <script>
 let app = getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
-import { ToPayOpre } from "../../utils/reqTools.js";
+import { ToPayOpre } from "@/utils/reqTools.js";
 var toPayOpre = new ToPayOpre();
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 export default {
   data() {
     return {

+ 69 - 59
src/pages/xghc-addrress/userAddress.vue

@@ -18,31 +18,31 @@
                                 <view class='item acea-row row-between-wrapper'>
                                     <view class='name'>姓名</view>
                                     <!-- <view class="address"> -->
-                                        <input type='text' placeholder='请输入姓名' v-model="userAddress.real_name" placeholder-class='placeholder' />
+                                    <input type='text' placeholder='请输入姓名' 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='number' placeholder='请输入联系电话' v-model='userAddress.phone' placeholder-class='placeholder' />
+                                    <input type='number' placeholder='请输入联系电话' v-model='userAddress.phone' placeholder-class='placeholder' />
                                     <!-- </view> -->
                                 </view>
                                 <view class='item acea-row row-between-wrapper'>
                                     <view class='name'>所在地区</view>
                                     <!-- <view class="address"> -->
-                                        <input type='text' placeholder='请填写具体地址' v-model='userAddress.region' placeholder-class='placeholder' />
+                                    <input type='text' placeholder='请填写具体地址' v-model='userAddress.region' placeholder-class='placeholder' />
                                     <!-- </view> -->
                                 </view>
                                 <view class='item acea-row row-between-wrapper'>
                                     <view class='name'>详细地址</view>
                                     <!-- <view class="address"> -->
-                                        <input type='text' placeholder='请填写具体地址' v-model='userAddress.detail' placeholder-class='placeholder' />
+                                    <input type='text' placeholder='请填写具体地址' v-model='userAddress.detail' placeholder-class='placeholder' />
                                     <!-- </view> -->
                                 </view>
                                 <view class='item acea-row'>
                                     <view class='name'>详细地址</view>
                                     <!-- <view class="address"> -->
-                                        <uni-data-checkbox v-model="is_default" :localdata="range"></uni-data-checkbox>
+                                    <uni-data-checkbox v-model="is_default" :localdata="range"></uni-data-checkbox>
                                     <!-- </view> -->
                                 </view>
                             </view>
@@ -85,7 +85,7 @@
     </uni-popup>
 </template>
 <script>
-import { get, post, u_post } from "@/request/api.js";
+import { get, post } from "@/request/api.js";
 import AddressParse from './zh-address-parse.min.js'
 let app = getApp();
 var appEv = app.$vm.$options;
@@ -104,7 +104,7 @@ export default {
 
             isadd: false,
             addressList: [],
-			presentId: "", //当前选择地址的id
+            presentId: "", //当前选择地址的id
         }
     },
     components: {},
@@ -129,22 +129,22 @@ export default {
             }
         },
         formSubmit() {
-			let url;
-			let data = {
+            let url;
+            let data = {
                 address: this.userAddress.region + this.userAddress.detail,
                 mobile: this.userAddress.phone,
                 name: this.userAddress.real_name,
                 is_default: this.is_default
             }
-			if(this.userAddress.id){
-				url = "user/editAddress";
-				data.id = this.userAddress.id
-			}else url = "user/addAddress";
+            if (this.userAddress.id) {
+                url = "user/editAddress";
+                data.id = this.userAddress.id
+            } else url = "user/addAddress";
             post(url, data).then(res => {
                 if (res.code === 0) {
                     appEv.errTips(res.msg);
-					this.loadAddress();
-					this.isadd = false;
+                    this.loadAddress();
+                    this.isadd = false;
                 }
             })
         },
@@ -157,44 +157,44 @@ export default {
             })
         },
         onSelect(i, s) {
-			this.presentId = i.id;
-			this.$emit('addressConfirm', i);
-			this.close();
+            this.presentId = i.id;
+            this.$emit('addressConfirm', i);
+            this.close();
         },
-		onadd(){
-			this.isadd = true;
-			this.userAddress = {};
-		},
-		onedit(da){
+        onadd() {
+            this.isadd = true;
+            this.userAddress = {};
+        },
+        onedit(da) {
             let options = {
                 type: 0, // 哪种方式解析,0:正则,1:树查找
                 textFilter: [], // 预清洗的字段
                 nameMaxLength: 4, // 查找最大的中文名字长度
             }
-			let parseResult = AddressParse(da.address, options)
-			this.userAddress.id = da.id;
-			this.userAddress.real_name = da.name;
-			this.userAddress.phone = da.mobile;
-			this.userAddress.detail = parseResult.detail;
-			this.userAddress.region = parseResult.province + '/' + parseResult.city + '/' + parseResult.area;
-			this.isadd = true
-		},
-		delAddress(id) {
-			post("user/delAddress",{id}).then(res=>{
+            let parseResult = AddressParse(da.address, options)
+            this.userAddress.id = da.id;
+            this.userAddress.real_name = da.name;
+            this.userAddress.phone = da.mobile;
+            this.userAddress.detail = parseResult.detail;
+            this.userAddress.region = parseResult.province + '/' + parseResult.city + '/' + parseResult.area;
+            this.isadd = true
+        },
+        delAddress(id) {
+            post("user/delAddress", { id }).then(res => {
                 if (res.code === 0) {
                     appEv.errTips(res.msg);
-					this.loadAddress();
-				}
-			})
-		},
+                    this.loadAddress();
+                }
+            })
+        },
 
         open(da) {
             this.$refs.popup.open('bottom')
             if (da == "add") this.isadd = true
-			else {
-				this.isadd = false;
-				this.presentId = da;
-			}
+            else {
+                this.isadd = false;
+                this.presentId = da;
+            }
         },
         close() {
             this.$refs.popup.close()
@@ -213,20 +213,21 @@ export default {
 .tit {
     height: 100rpx;
     line-height: 100rpx;
-	background: #fff;
+    background: #fff;
     border-radius: 30rpx 30rpx 0 0;
     color: #333;
-	.cancel{
-		padding: 0 30rpx;
-	}
+
+    .cancel {
+        padding: 0 30rpx;
+    }
 
     .close {
         float: right;
-		padding: 0 30rpx;
+        padding: 0 30rpx;
     }
 }
 
-.s_con{
+.s_con {
     height: calc(100% - 100rpx);
     // overflow-y: auto;
     padding-top: 20rpx;
@@ -259,33 +260,41 @@ export default {
 
 .addAddress {
     width: 100%;
+
     .list {
         background-color: #fff;
+
         .item {
             padding: 30rpx;
             border-top: 1rpx solid #eee;
+
             // position: relative;
             .icon-dizhi {
                 font-size: 36rpx !important;
             }
+
             .name {
                 width: 180rpx;
                 font-size: 30rpx;
                 color: #333;
             }
+
             .address {
                 flex: 1;
             }
+
             input {
                 flex: 1;
                 font-size: 0 30rpx;
             }
         }
     }
+
     .default {
         padding: 30rpx;
         background-color: #fff;
     }
+
     .keepBnt {
         width: 690rpx;
         height: 86rpx;
@@ -372,8 +381,8 @@ export default {
     }
 
     // .swipeAction_item {
-        // background: #fff;
-        // margin-bottom: 20rpx;
+    // background: #fff;
+    // margin-bottom: 20rpx;
     // }
 
     .btns {
@@ -395,9 +404,10 @@ export default {
         .del {
             background: rgba(238, 10, 36, 0.5);
         }
-		.iconfont{
-			color: #fff;
-		}
+
+        .iconfont {
+            color: #fff;
+        }
     }
 }
 
@@ -407,12 +417,12 @@ export default {
     margin-bottom: 20rpx;
 }
 
-.defaultAddress{
-	border: 1rpx solid #2DB389;
-	color: #2DB389;
-	border-radius: 6rpx;
-	font-size: 18rpx;
-	padding: 0 6rpx;
-	margin-left: 20rpx;
+.defaultAddress {
+    border: 1rpx solid #2DB389;
+    color: #2DB389;
+    border-radius: 6rpx;
+    font-size: 18rpx;
+    padding: 0 6rpx;
+    margin-left: 20rpx;
 }
 </style>

+ 1 - 17
src/request/api.js

@@ -1,6 +1,5 @@
 import host from "./config.js"
 import api from "./request.js"
-const user = uni.getStorageSync('systemUserInfo');
 
 export function get(url, params, baseURL) {
 	return api({
@@ -18,19 +17,4 @@ export function post(url, params, baseURL) {
 		header: { "Content-Type": "application/x-www-form-urlencoded" },
 		baseURL,
 	})
-}
-
-export function u_post(url, params, baseURL) {
-	params = {
-		...params,
-		userId: user.userId
-	}
-	return api({
-		url,
-		params,
-		method: "POST",
-		header: { "Content-Type": "application/x-www-form-urlencoded" },
-		baseURL,
-	})
-}
-
+}