浏览代码

no message

DaMowang 2 年之前
父节点
当前提交
e9a74b36ae

+ 24 - 20
src/components/activation/activation.vue

@@ -7,11 +7,7 @@
             </div>
             </div>
             <div class="p_con">
             <div class="p_con">
                 <div class="con_txt">请输入激活码</div>
                 <div class="con_txt">请输入激活码</div>
-                <input
-                    class="activation_code dinB"
-                    :focus="true"
-                    v-model="code"
-                />
+                <input class="activation_code dinB" :focus="focus" v-model="code" />
             </div>
             </div>
             <div class="btnbar">
             <div class="btnbar">
                 <div class="btn" @click="jihuo">立即激活</div>
                 <div class="btn" @click="jihuo">立即激活</div>
@@ -19,7 +15,6 @@
         </div>
         </div>
     </uni-popup>
     </uni-popup>
 </template>
 </template>
-
 <script>
 <script>
 import { post } from "@/request/api.js";
 import { post } from "@/request/api.js";
 export default {
 export default {
@@ -35,20 +30,23 @@ export default {
     data() {
     data() {
         return {
         return {
             code: "", //激活码
             code: "", //激活码
+
+            focus: false
         };
         };
     },
     },
     methods: {
     methods: {
-        jihuo(){
+        jihuo() {
             let code = this.code
             let code = this.code
-            post("local/activation",{code}).then(res=>{
-                if(res.code == 0){
+            post("local/activation", { code }).then(res => {
+                if (res.code == 0) {
                     uni.showToast({ title: "激活成功", icon: "none" });
                     uni.showToast({ title: "激活成功", icon: "none" });
                     this.close()
                     this.close()
                 }
                 }
             })
             })
         },
         },
         open() {
         open() {
-            this.$refs.popup.open('center')
+            this.$refs.popup.open('center');
+            this.focus = true
         },
         },
         close() {
         close() {
             this.$refs.popup.close()
             this.$refs.popup.close()
@@ -59,33 +57,37 @@ export default {
     mounted() {},
     mounted() {},
 };
 };
 </script>
 </script>
-
 <style scoped lang='scss'>
 <style scoped lang='scss'>
-.popup_con{
+.popup_con {
     background-color: #fff;
     background-color: #fff;
     width: 80vw;
     width: 80vw;
     border-radius: 16rpx;
     border-radius: 16rpx;
     padding: 0 30rpx 28rpx;
     padding: 0 30rpx 28rpx;
-    .p_tit{
+
+    .p_tit {
         min-height: 80rpx;
         min-height: 80rpx;
         line-height: 80rpx;
         line-height: 80rpx;
         text-align: center;
         text-align: center;
-        .close{
+
+        .close {
             color: #666;
             color: #666;
             font-size: 40rpx;
             font-size: 40rpx;
             font-weight: bold;
             font-weight: bold;
             float: right;
             float: right;
         }
         }
     }
     }
-    .p_con{
+
+    .p_con {
         padding: 50rpx 0;
         padding: 50rpx 0;
-        .con_txt{
+
+        .con_txt {
             color: #999;
             color: #999;
             font-size: 30rpx;
             font-size: 30rpx;
             text-align: center;
             text-align: center;
             margin-bottom: 16rpx;
             margin-bottom: 16rpx;
         }
         }
-        .activation_code{
+
+        .activation_code {
             height: 70rpx;
             height: 70rpx;
             background-color: rgba($color: #000, $alpha: 0.05);
             background-color: rgba($color: #000, $alpha: 0.05);
             border-radius: 12rpx;
             border-radius: 12rpx;
@@ -96,14 +98,16 @@ export default {
         }
         }
 
 
     }
     }
-    .btnbar{
+
+    .btnbar {
+
         // margin-top: 28rpx;
         // margin-top: 28rpx;
-        .btn{
+        .btn {
             font-weight: bold;
             font-weight: bold;
             height: 70rpx;
             height: 70rpx;
             line-height: 70rpx;
             line-height: 70rpx;
             text-align: center;
             text-align: center;
-            background: radial-gradient(circle, #d3aa79,#ebcda8);
+            background: radial-gradient(circle, #d3aa79, #ebcda8);
             border-radius: 35rpx;
             border-radius: 35rpx;
         }
         }
     }
     }

+ 28 - 8
src/pages/cash/index.vue

@@ -12,7 +12,7 @@
       </view>
       </view>
       <view class="option flex_r flex_ac flex_jb">
       <view class="option flex_r flex_ac flex_jb">
         <view class="balance flex_r flex_ac"
         <view class="balance flex_r flex_ac"
-          >账户余额¥{{ userinfo.user_money }}</view
+          >账户余额¥{{ user_money }}</view
         >
         >
         <view class="option_text" @tap="getListPage">提现记录</view>
         <view class="option_text" @tap="getListPage">提现记录</view>
       </view>
       </view>
@@ -48,11 +48,21 @@ export default {
       imgs: "",
       imgs: "",
       index: 0,
       index: 0,
       userinfo: undefined, // 获取用户信息
       userinfo: undefined, // 获取用户信息
+      local_uinfo: undefined,
+
+      user_money: 0, //余额
+
+      islocal: false
     };
     };
   },
   },
   onLoad: function (e) {
   onLoad: function (e) {
-    this.userinfo = uni.getStorageSync("userinfo");
-    this.inputMoney = "";
+    if(e.type == "local"){
+      this.getLU();
+      this.islocal = true;
+    }else{
+      this.getU();
+      this.islocal = false;
+    }
     this.getExolain();
     this.getExolain();
   },
   },
   methods: {
   methods: {
@@ -63,6 +73,7 @@ export default {
     },
     },
     onSubForm() {
     onSubForm() {
       let that = this;
       let that = this;
+      let url = this.islocal ? "local/withdraw" : "v1/user/withdraw"
       if (this.inputMoney == "") {
       if (this.inputMoney == "") {
         appEv.errTips("请输入金额");
         appEv.errTips("请输入金额");
         return;
         return;
@@ -75,9 +86,9 @@ export default {
         });
         });
         return;
         return;
       }
       }
-      if (Number(this.inputMoney) > Number(this.userinfo.user_money)) {
+      if (Number(this.inputMoney) > Number(this.user_money)) {
         uni.showModal({
         uni.showModal({
-          content: `当前可提现${that.userinfo.user_money}`,
+          content: `当前可提现${that.user_money}`,
           showCancel: false,
           showCancel: false,
           success(res) {},
           success(res) {},
         });
         });
@@ -92,17 +103,18 @@ export default {
         pay_code: this.imgs,
         pay_code: this.imgs,
         w_type: 1,
         w_type: 1,
       };
       };
-      post("v1/user/withdraw", data).then( async (res) => {
+      post(url, data).then((res) => {
         uni.hideLoading();
         uni.hideLoading();
         if (res.code === 0) {
         if (res.code === 0) {
           this.inputMoney = "";
           this.inputMoney = "";
-          this.userinfo = await uni.userfun();
           uni.showModal({
           uni.showModal({
             content: `提交成功,请等待审核!`,
             content: `提交成功,请等待审核!`,
             confirmText: "知道了",
             confirmText: "知道了",
             showCancel: false,
             showCancel: false,
             success(res) {},
             success(res) {},
           });
           });
+          if(this.islocal) this.getLU()
+          else this.getU()
         } else {
         } else {
           appEv.errTips(res.msg || "");
           appEv.errTips(res.msg || "");
         }
         }
@@ -141,12 +153,20 @@ export default {
         },
         },
       });
       });
     },
     },
-
     getListPage() {
     getListPage() {
       uni.navigateTo({
       uni.navigateTo({
         url: "/pages/accountDetails/withdraw",
         url: "/pages/accountDetails/withdraw",
       });
       });
     },
     },
+    
+    async getU() {
+      this.userinfo = await uni.userfun();
+      this.user_money = this.userinfo.user_money;
+    },
+    async getLU() {
+      this.local_uinfo = await uni.Luserfun()
+      this.user_money = this.local_uinfo.property;
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 32 - 26
src/pages/my/index.vue

@@ -84,7 +84,7 @@
     <view class="fun_container">
     <view class="fun_container">
       <view class="fun mar_t30">
       <view class="fun mar_t30">
         <view class="fun_title">我的账户</view>
         <view class="fun_title">我的账户</view>
-        <view class="fun_con mar_t50 flex_r flex_ac flex_jb">
+        <view class="fun_con mar_t50 flex_r flex_ac">
           <!-- <navigator class="fun_list flex_c flex_ac" url="/pages/top-up/index" hover-class="none">
           <!-- <navigator class="fun_list flex_c flex_ac" url="/pages/top-up/index" hover-class="none">
             <image class="fun_img" src="/static/my/recharge.png" mode=""></image>
             <image class="fun_img" src="/static/my/recharge.png" mode=""></image>
             <view class="fun_text">充值</view>
             <view class="fun_text">充值</view>
@@ -109,7 +109,7 @@
       </view>
       </view>
       <view class="fun mar_t30">
       <view class="fun mar_t30">
         <view class="fun_title">账户明细</view>
         <view class="fun_title">账户明细</view>
-        <view class="fun_con mar_t50 flex_r flex_ac flex_jb">
+        <view class="fun_con mar_t50 flex_r flex_ac">
           <navigator class="fun_list flex_c flex_ac" url="/pages/accountDetails/running" hover-class="none">
           <navigator class="fun_list flex_c flex_ac" url="/pages/accountDetails/running" hover-class="none">
             <image class="fun_img" src="/static/my/fund.png" mode=""></image>
             <image class="fun_img" src="/static/my/fund.png" mode=""></image>
             <view class="fun_text">流水明细</view>
             <view class="fun_text">流水明细</view>
@@ -118,9 +118,6 @@
             <image class="fun_img" src="/static/my/withdraw.png" mode=""></image>
             <image class="fun_img" src="/static/my/withdraw.png" mode=""></image>
             <view class="fun_text">提现明细</view>
             <view class="fun_text">提现明细</view>
           </navigator>
           </navigator>
-          <navigator></navigator>
-          <navigator></navigator>
-          <navigator></navigator>
         </view>
         </view>
       </view>
       </view>
       <view class="fun mar_t30">
       <view class="fun mar_t30">
@@ -154,7 +151,7 @@
       </view>
       </view>
       <view class="fun mar_t30">
       <view class="fun mar_t30">
         <view class="fun_title">本地生活</view>
         <view class="fun_title">本地生活</view>
-        <view class="fun_con mar_t50 flex_r flex_ac flex_jb">
+        <view class="fun_con mar_t50 flex_r flex_ac">
           <navigator v-if="local_uinfo.level_id>1" class="fun_list flex_c flex_ac" url="/pagesB/orderingfood/group" hover-class="none">
           <navigator v-if="local_uinfo.level_id>1" class="fun_list flex_c flex_ac" url="/pagesB/orderingfood/group" hover-class="none">
             <image class="fun_img" src="/static/my/l_group.png" mode=""></image>
             <image class="fun_img" src="/static/my/l_group.png" mode=""></image>
             <view class="fun_text">我的团队</view>
             <view class="fun_text">我的团队</view>
@@ -163,14 +160,19 @@
             <image class="fun_img" src="/static/my/order_history.png" mode=""></image>
             <image class="fun_img" src="/static/my/order_history.png" mode=""></image>
             <view class="fun_text">历史订单</view>
             <view class="fun_text">历史订单</view>
           </navigator>
           </navigator>
-          <navigator></navigator>
-          <navigator></navigator>
-          <navigator></navigator>
+          <navigator class="fun_list flex_c flex_ac" @click="activation" hover-class="none">
+            <image class="fun_img" src="/static/my/upgrade.png" mode=""></image>
+            <view class="fun_text">激活升级</view>
+          </navigator>
+          <navigator class="fun_list flex_c flex_ac" @click="getToCash('local')" hover-class="none">
+            <image class="fun_img" src="/static/my/deposit.png" mode=""></image>
+            <view class="fun_text">提现</view>
+          </navigator>
         </view>
         </view>
       </view>
       </view>
       <view class="fun mar_t30">
       <view class="fun mar_t30">
         <view class="fun_title">其他</view>
         <view class="fun_title">其他</view>
-        <view class="fun_con mar_t50 flex_r flex_ac flex_jb">
+        <view class="fun_con mar_t50 flex_r flex_ac">
           <navigator class="fun_list flex_c flex_ac" url="/pagesB/address/list" hover-class="none">
           <navigator class="fun_list flex_c flex_ac" url="/pagesB/address/list" hover-class="none">
             <image class="fun_img" src="/static/my/dizhi.png" mode=""></image>
             <image class="fun_img" src="/static/my/dizhi.png" mode=""></image>
             <view class="fun_text">地址管理</view>
             <view class="fun_text">地址管理</view>
@@ -183,13 +185,11 @@
             <image class="fun_img" src="/static/my/assistantHistory.png" mode=""></image>
             <image class="fun_img" src="/static/my/assistantHistory.png" mode=""></image>
             <view class="fun_text">开票历史</view>
             <view class="fun_text">开票历史</view>
           </navigator>
           </navigator>
-          <navigator></navigator>
-          <navigator></navigator>
         </view>
         </view>
       </view>
       </view>
       <view class="fun mar_t30">
       <view class="fun mar_t30">
         <view class="fun_title">我的服务</view>
         <view class="fun_title">我的服务</view>
-        <view class="fun_con mar_t50 flex_r flex_ac flex_jb">
+        <view class="fun_con mar_t50 flex_r flex_ac">
           <navigator class="fun_list flex_c flex_ac" @click="goto('/pages/agreement/index',{tit:'关于我们',type:7})" hover-class="none">
           <navigator class="fun_list flex_c flex_ac" @click="goto('/pages/agreement/index',{tit:'关于我们',type:7})" hover-class="none">
             <image class="fun_img" src="/static/my/about.png" mode=""></image>
             <image class="fun_img" src="/static/my/about.png" mode=""></image>
             <view class="fun_text">关于我们</view>
             <view class="fun_text">关于我们</view>
@@ -212,10 +212,11 @@
       </view>
       </view>
     </view>
     </view>
     <view class="fz_w_text">让数字经济赋能美好生活!</view>
     <view class="fz_w_text">让数字经济赋能美好生活!</view>
-    <!-- 功能列表-end -->
+    
     <!-- 授权 -->
     <!-- 授权 -->
     <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
     <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
-    <!-- 授权-end -->
+    <!-- 激活升级 -->
+    <activation ref="activation" tit="激活" />
   </view>
   </view>
 </template>
 </template>
 <script>
 <script>
@@ -223,11 +224,12 @@ let app = getApp();
 var appEv = app.$vm.$options;
 var appEv = app.$vm.$options;
 import uniCopy from "@/utils/copy";
 import uniCopy from "@/utils/copy";
 import authorizeModule from "@/components/authorize-module/index";
 import authorizeModule from "@/components/authorize-module/index";
+import activation from "@/components/activation/activation.vue"
 import { post } from "@/request/api.js";
 import { post } from "@/request/api.js";
 export default {
 export default {
   components: {
   components: {
     authorizeModule,
     authorizeModule,
-    // newauthorize
+    activation
   },
   },
   data() {
   data() {
     return {
     return {
@@ -358,16 +360,16 @@ export default {
       }
       }
     },
     },
     // 跳转到提现页面
     // 跳转到提现页面
-    getToCash() {
+    getToCash(type) {
       if (this.isAuthentication) {
       if (this.isAuthentication) {
         if (this.userinfo.is_authentication == 1) {
         if (this.userinfo.is_authentication == 1) {
-          this.goto("/pages/cash/index")
+          this.goto("/pages/cash/index",{type})
         } else {
         } else {
           appEv.errTips("您还未实名");
           appEv.errTips("您还未实名");
           this.goToAutonym();
           this.goToAutonym();
         }
         }
       } else {
       } else {
-        this.goto("/pages/cash/index")
+        this.goto("/pages/cash/index",{type})
       }
       }
     },
     },
     // 复制账号
     // 复制账号
@@ -418,13 +420,12 @@ export default {
         }
         }
       });
       });
     },
     },
-    getLU() {
-        post("local/userinfo").then(res => {
-            if (res.code == 0) {
-                this.local_uinfo = res.data
-            }
-        })
+    async getLU() {
+      this.local_uinfo = await uni.Luserfun()
     },
     },
+    activation(){
+        this.$refs.activation.open()
+    }
   },
   },
 };
 };
 </script>
 </script>
@@ -668,6 +669,10 @@ page {
   color: #333333;
   color: #333333;
 }
 }
 
 
+.fun_list{
+  width: 25%;
+}
+
 .fun_list button::after {
 .fun_list button::after {
   border: 0 !important;
   border: 0 !important;
 }
 }
@@ -692,6 +697,7 @@ page {
 }
 }
 
 
 .fun_title {
 .fun_title {
+  padding: 0 30rpx;
   font-size: 32rpx;
   font-size: 32rpx;
   color: #232323;
   color: #232323;
   font-family: "SourceHanSansSC-Bold";
   font-family: "SourceHanSansSC-Bold";
@@ -703,7 +709,7 @@ page {
   overflow: hidden;
   overflow: hidden;
   border-radius: 16rpx;
   border-radius: 16rpx;
   background: #fff;
   background: #fff;
-  padding: 30rpx;
+  padding: 30rpx 0;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 
 

+ 2 - 6
src/pages/orderingfood/merchantlist.vue

@@ -153,12 +153,8 @@ export default {
                 }
                 }
             })
             })
         },
         },
-        getLU() {
-            post("local/userinfo").then(res => {
-                if (res.code == 0) {
-                    this.local_uinfo = res.data
-                }
-            })
+        async getLU() {
+            this.local_uinfo = await uni.Luserfun()
         },
         },
         typeto(va) {
         typeto(va) {
             switch (va) {
             switch (va) {

+ 2 - 6
src/pagesB/orderingfood/activationcode.vue

@@ -50,12 +50,8 @@ export default {
         }
         }
     },
     },
     methods: {
     methods: {
-        getLU() {
-            post("local/userinfo").then(res => {
-                if (res.code == 0) {
-                    this.local_uinfo = res.data
-                }
-            })
+        async getLU() {
+            this.local_uinfo = await uni.Luserfun()
         },
         },
         getPurview() {
         getPurview() {
             post("local/getPurview").then(res => {
             post("local/getPurview").then(res => {

+ 6 - 16
src/pagesB/orderingfood/orderingfood.vue

@@ -307,11 +307,6 @@ export default {
                 post("local/getProduct", { ...this.mda, product_id: data.product_id }).then(res => {
                 post("local/getProduct", { ...this.mda, product_id: data.product_id }).then(res => {
                     if (res.code === 0) {
                     if (res.code === 0) {
                         let da = res.data.data
                         let da = res.data.data
-
-                        // if(da.brand_id==19){
-                        //     details.optional
-                        // }
-
                         this.goodsOneData = da;
                         this.goodsOneData = da;
                         this.goodShow = true;
                         this.goodShow = true;
 
 
@@ -334,6 +329,7 @@ export default {
             this.naixueSpec();
             this.naixueSpec();
         },
         },
         naixueSpec(){
         naixueSpec(){
+            this.childProductData.product_details = []
             let da = this.goodsOneData.details.spu_specs;
             let da = this.goodsOneData.details.spu_specs;
             let arr = [], obj = this.childProductData.selectSpecification || {};
             let arr = [], obj = this.childProductData.selectSpecification || {};
             let arrs = [];
             let arrs = [];
@@ -353,12 +349,9 @@ export default {
                     }
                     }
                 }
                 }
             }
             }
-            let sku = {
-                sku_code : arrs[0].code
-            }
             this.childProductData.selectSpecArr = arr
             this.childProductData.selectSpecArr = arr
             this.childProductData.selectSpecification = obj
             this.childProductData.selectSpecification = obj
-            this.childProductData.product_details = sku
+            this.childProductData.product_details[0].sku_code = arrs[0].code
         },
         },
         naixue(key,r) {
         naixue(key,r) {
             let selectSpecification = this.childProductData.selectSpecification || {};
             let selectSpecification = this.childProductData.selectSpecification || {};
@@ -369,10 +362,7 @@ export default {
             if(!r) selectSpecification['加料'] = da[key].name
             if(!r) selectSpecification['加料'] = da[key].name
             else delete selectSpecification['加料']
             else delete selectSpecification['加料']
             this.childProductData.selectSpecification = selectSpecification
             this.childProductData.selectSpecification = selectSpecification
-            let sku = {
-                accessories_code: da[key].code
-            }
-            this.childProductData.product_details = sku
+            this.childProductData.product_details[0].accessories_code = da[key].code
         },
         },
         // 选择规格标签 瑞辛
         // 选择规格标签 瑞辛
         ruixins(index, key) {
         ruixins(index, key) {
@@ -407,7 +397,7 @@ export default {
             this.childProductData = {
             this.childProductData = {
                 selectSpecArr: arr,
                 selectSpecArr: arr,
                 selectSpecification: obj,
                 selectSpecification: obj,
-                product_details: sku
+                product_details: [sku]
             }
             }
         },
         },
         xichas(index, key){
         xichas(index, key){
@@ -432,10 +422,10 @@ export default {
                     }
                     }
                 }
                 }
             }
             }
-            let product_details = {
+            let product_details = [{
                 accessories_id: accessories_id.join(),
                 accessories_id: accessories_id.join(),
                 sku_id: sku_id.join()
                 sku_id: sku_id.join()
-            }
+            }]
             this.childProductData = {
             this.childProductData = {
                 selectSpecArr: arr,
                 selectSpecArr: arr,
                 selectSpecification: obj,
                 selectSpecification: obj,

+ 4 - 3
src/pagesB/orderingfood/payTheBill.vue

@@ -78,11 +78,11 @@ export default {
         getIntegral(){
         getIntegral(){
             post("local/getIntegral").then(res=>{
             post("local/getIntegral").then(res=>{
                 if (res.code == 0) {
                 if (res.code == 0) {
-                    let va = res.data.integral
+                    let i1 = res.data.integral, i2 = res.data.chabao;
                     this.Integral = this.$h.Mul(va,100);
                     this.Integral = this.$h.Mul(va,100);
-                    this.deduction = this.$h.Mul(this.cartTotal,va).toFixed(2);
+                    this.deduction = this.$h.Mul(this.cartTotal,i1).toFixed(2);
                     this.actuallypaid = this.$h.Sub(this.cartTotal,this.deduction);
                     this.actuallypaid = this.$h.Sub(this.cartTotal,this.deduction);
-                    this.chabao = this.$h.Mul(this.actuallypaid,va).toFixed(2);
+                    this.chabao = this.$h.Mul(this.actuallypaid,i2).toFixed(2);
                 }
                 }
             })
             })
         },
         },
@@ -130,6 +130,7 @@ export default {
                       if (!rea) {
                       if (!rea) {
                         // 支付成功
                         // 支付成功
                         uni.showToast({ title: "支付成功", icon: "none" });
                         uni.showToast({ title: "支付成功", icon: "none" });
+                        this.goto("pagesB/orderingfood/orderlist")
                       } else {
                       } else {
                         // 支付失败
                         // 支付失败
                         uni.showToast({ title: "支付已取消", icon: "none" });
                         uni.showToast({ title: "支付已取消", icon: "none" });

二进制
src/static/my/deposit.png


二进制
src/static/my/upgrade.png


+ 12 - 4
src/utils/run_now.js

@@ -19,7 +19,15 @@ uni.userfun = () => {
         });
         });
     })
     })
 }
 }
-
-// uni.userfun().then(res=>{
-//     console.log('----',res);
-// })
+uni.Luserfun = () => {
+    return new Promise((resolve, reject) => {
+        post("local/userinfo").then((res) => {
+            if (res.code === 0) {
+                uni.setStorageSync("localInfo", res.data);
+                resolve(res.data)
+            } else {
+                resolve({})
+            }
+        });
+    })
+}