Pārlūkot izejas kodu

1.本地生活-快捷买单支付问题处理
2.商家码海报保存
3.添加商家余额流水

DaMowang 2 gadi atpakaļ
vecāks
revīzija
2ad5867c1f

+ 6 - 0
src/pages.json

@@ -518,6 +518,12 @@
 					"style": {
 						"navigationBarTitleText": "区域商家"
 					}
+				},
+				{
+					"path": "settledMerchant/balanceLog",
+					"style": {
+						"navigationBarTitleText": "流水明细"
+					}
 				}
 			]
 		}

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

@@ -58,7 +58,7 @@ export default {
   methods: {
     loadData: function () {
       let data = {
-        page: page,
+        page: this.page,
         rows:20,
         type: this.current,
       };

+ 1 - 7
src/pages/autonym-submit/index.vue

@@ -33,13 +33,7 @@
 </template>
 
 <script>
-	import {
-		post
-	} from "@/request/api.js";
-	import {
-		ToPayOpre
-	} from "@/utils/reqTools.js";
-	let toPayOpre = new ToPayOpre();
+	import { post } from "@/request/api.js";
 	export default {
 		data() {
 			return {

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

@@ -337,7 +337,7 @@ export default {
         typeto(va) {
             switch (va) {
                 case 1: return "消费商";
-                case 2: return "推广大使";
+                case 2: return "链接大使";
                 case 3: return "合伙人";
                 case 4: return "联合创始人";
                 case 5: return "联合发起人";

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

@@ -43,7 +43,7 @@ export default {
             type: '',
             goods: [], // 商品列表
             haveGoods: false, // 是否有商品
-            is_vip: undefined, //是否筛选“推广大使礼包”专区
+            is_vip: undefined, //是否筛选“链接大使礼包”专区
         };
     },
     onLoad(e) {
@@ -51,7 +51,7 @@ export default {
         this.title = this.tidyTpye(e.type);
         if(e.is_vip) {
             this.is_vip = e.is_vip;
-            this.title = "推广大使礼包";
+            this.title = "链接大使礼包";
         }
         uni.setNavigationBarTitle({
             title: this.title

+ 33 - 27
src/pages/szw-order-details/index.vue

@@ -73,7 +73,7 @@
                 <view class="detail_btn-row">
                     <template v-if="orderInfo.order_status != 5">
                         <view class="btn cancel-btn" @tap="toCancel" v-if="[0,1].includes(orderInfo.order_status)">取消订单</view>
-                        <view class="btn topay-btn" @tap="toPay" v-if="[0,2].includes(orderInfo.pay_status)">立即支付</view>
+                        <view class="btn topay-btn" @tap="toPay(orderInfo.order_id)" v-if="[0,2].includes(orderInfo.pay_status)">立即支付</view>
                         <view class="btn topay-btn" @tap="toTake" v-if="[0,1,7].includes(orderInfo.order_status)&&[1].includes(orderInfo.pay_status)">确认收货</view>
                         <view class="btn topay-btn" @tap="toCode(orderInfo)" v-if="[8].includes(orderInfo.order_status)">待自提</view>
                     </template>
@@ -89,6 +89,8 @@
 <script>
 var utils = require("@/utils/utils.js");
 import { post } from "@/request/api.js";
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
 export default {
     data() {
         return {
@@ -160,34 +162,38 @@ export default {
             });
         },
         // 立即支付
-        toPay(e) {
-            let data = {
-                orderDetailIds: this.orderId,
-                types: 1,
-                price: this.orderInfo.orderDetail.totalWxPrice,
-                account: this.orderInfo.orderDetail.totalAccount,
-                teaIntegral: this.orderInfo.orderDetail.totalTeaInt,
-                pfIntegral: this.orderInfo.orderDetail.totalPfInt,
-                xfIntegral: this.orderInfo.orderDetail.totalXfInt,
-                zfType: this.orderInfo.orderDetail.patType,
-                ojsType: this.orderInfo.orderDetail.ojsType,
-            };
-            var info;
-            info = reqApi.payOrder(data);
-            var that = this;
-            if (info) {
-                info.then((res) => {
-                    if (res.data.status == 200) {
-                        toPayOpre.toPay(res.data.payParam);
-                    } else {
-                        that.$toast(res.data.msg || "支付失败");
-                    }
-                });
-            }
+        toPay(id) {
+            let type = "H5";
+            // #ifdef  H5
+            type = "H5";
+            // #endif
+            // #ifdef  APP
+            type = "app";
+            // #endif
+            // #ifdef  MP-WEIXIN
+            type = "jsapi";
+            // #endif
+            post("v1/goods/payOrder", {
+                id, trade_type: type,
+            }).then((res) => {
+                if (res.code === 0) {
+                    toPayOpre.toPay(res.data.data, (da) => {
+                        if (!da) {
+                            // 支付成功
+                            this.$toast("支付成功");
+                        } else {
+                            // 支付失败
+                            this.$toast("支付已取消");
+                        }
+                        // this.$toast('支付成功');
+                        this.loadData();
+                    });
+                }
+            });
         },
         toCode(e){
-      this.goto("/pagesB/order/verificationCode", { id: e.order_id });
-    },
+            this.goto("/pagesB/order/verificationCode", { id: e.order_id });
+        },
         // 确认收货
         toTake() {
             let that = this;

+ 1 - 1
src/pagesB/orderingfood/activationcode.vue

@@ -50,7 +50,7 @@ export default {
 
             tabs: [
                 // { n: "消费商", i: 1, k: "vip_num" },
-                { n: "推广大使", i: 2, k: "lord_num" },
+                { n: "链接大使", i: 2, k: "lord_num" },
                 { n: "合伙人", i: 3, k: "helper_num" },
                 { n: "联合创始人", i: 4, k: "vice_num" },
             ],

+ 1 - 1
src/pagesB/orderingfood/orderlist.vue

@@ -73,7 +73,7 @@
                     </div>
                     <div class="p2 flex_r flex_jb">
                         <div class="goods good2 ">金额</div>
-                        <div class="g_amount"><span class="amount dinB">{{ i.order_amount }}</span></div>
+                        <div class="g_amount"><span class="amount dinB">{{ i.balance_amount }}</span></div>
                     </div>
                     <div class="p3">订单编号:{{ i.order_no }}</div>
                     <div class="p3 mt-10">下单时间:{{ i.create_time }}</div>

+ 35 - 16
src/pagesC/components/createCode/index.vue

@@ -1,9 +1,11 @@
 <template>
-    <view class="content" v-if="isShow" @click.stop="isShow=false">
-        <canvas @click.stop="" :style="{ width: canvasW + 'px', height: canvasH + 'px' }" canvas-id="my-canvas"></canvas>
+<view class="createCode" v-if="isShow" @click.stop="isShow=false">
+    <view class="content">
+        <canvas :style="{ width: canvasW + 'px', height: canvasH + 'px' }" canvas-id="my-canvas"></canvas>
         <view class="save-btn" @click.stop="saveImage" v-if="!isLoading">保存图片</view>
-        <image id="Image" :src="qrcode" v-show="false"></image>
     </view>
+    <canvas :style="{ width: canvasW * 2 + 'px', height: canvasH * 2 + 'px' }" canvas-id="big-canvas" class="big-canvas"></canvas>
+</view>
 </template>
 <script>
 import { post } from "@/request/api.js";
@@ -18,7 +20,7 @@ export default {
             isLoading: true,
             title: "草莓千层蛋糕",
             qrcode: 'https://oss.zhangyubk.com/cmqrcode.jpg',
-            headerImg: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/268c896c47298c7c79a8270c36076741e8f15b0fjpg"
+            headerImg: "https://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/268c896c47298c7c79a8270c36076741e8f15b0fjpg"
         }
     },
     methods: {
@@ -27,10 +29,7 @@ export default {
             this.isShow = true
             this.title = da.name
             this.isLoading = true
-            uni.showLoading({
-                title: '加载中...',
-                mask: true
-            })
+            uni.showLoading({ title: '加载中...', mask: true })
             this.getQrcode(da.id)
         },
         // 获取商家码
@@ -45,34 +44,44 @@ export default {
         //初始化画布
         async __init() {
             this.ctx = uni.createCanvasContext('my-canvas', this)
+            this.bigCtx = uni.createCanvasContext('big-canvas', this)
             this.canvasW = uni.upx2px(600);
             this.canvasH = uni.upx2px(820);
             //设置画布背景透明
             this.ctx.setFillStyle('rgba(255, 255, 255, 0)')
+            this.bigCtx.setFillStyle('rgba(255, 255, 255, 0)')
             //设置画布大小
             this.ctx.fillRect(0, 0, this.canvasW, this.canvasH)
+            this.bigCtx.fillRect(0, 0, this.canvasW * 2, this.canvasH * 2)
             //绘制圆角背景
             this.drawRoundRect(this.ctx, 0, 0, this.canvasW, this.canvasH, uni.upx2px(18), '#FFFFFF')
+            this.drawRoundRect(this.bigCtx, 0, 0, this.canvasW * 2, this.canvasH * 2, uni.upx2px(36), '#FFFFFF')
             //获取标题图片
             let headerImg = await this.getImageInfo(this.headerImg)
-            let hW = uni.upx2px(600);
-            let hH = uni.upx2px(820);
             //绘制标题图
-            this.drawRoundImg(this.ctx, headerImg.path, ((this.canvasW - hW) / 2), ((this.canvasW - hW) / 2), hW, hH, 8)
+            this.drawRoundImg(this.ctx, headerImg.path, 0, 0, this.canvasW, this.canvasH, 8)
+            this.drawRoundImg(this.bigCtx, headerImg.path, 0, 0, this.canvasW * 2, this.canvasH * 2, 16)
             //绘制标题
             this.ctx.setFontSize(14); //设置标题字体大小
             this.ctx.setFillStyle('#333'); //设置标题文本颜色
             this.ctx.textAlign = 'center';
             this.ctx.fillText(this.title, (this.canvasW / 2), (this.canvasH - uni.upx2px(275)))
+            this.bigCtx.setFontSize(28); //设置标题字体大小
+            this.bigCtx.setFillStyle('#333'); //设置标题文本颜色
+            this.bigCtx.textAlign = 'center';
+            this.bigCtx.fillText(this.title, this.canvasW, (this.canvasH * 2 - uni.upx2px(275 * 2)))
             //小程序码
+            let qrH = uni.upx2px(316);
             let qrcodeImg = await this.getImageInfo(this.qrcode)
-            this.ctx.drawImage(qrcodeImg.path, (this.canvasW / 2) - uni.upx2px(158), uni.upx2px(190), uni.upx2px(316), uni.upx2px(316))
+            this.ctx.drawImage(qrcodeImg.path, ((this.canvasW - qrH) / 2), uni.upx2px(190), qrH, qrH)
+            this.bigCtx.drawImage(qrcodeImg.path, this.canvasW - qrH, uni.upx2px(190 * 2), qrH * 2, qrH * 2)
             //延迟渲染
             setTimeout(() => {
                 this.ctx.draw(true, () => {
                     this.isLoading = false
                     uni.hideLoading()
                 })
+                this.bigCtx.draw(true, () => {})
             }, 500)
         },
         //带圆角图片
@@ -147,7 +156,7 @@ export default {
         runSave(){
             var that = this
             uni.canvasToTempFilePath({
-                canvasId: 'my-canvas',
+                canvasId: 'big-canvas',
                 quality: 1,
                 complete: (res) => {
                     console.log('保存到相册', res);
@@ -171,17 +180,23 @@ export default {
 }
 </script>
 <style scoped lang="scss">
-.content {
+.createCode{
     position: fixed;
     top: 0;
     left: 0;
-    right: 0;
-    bottom: 0;
+    width: 100%;
+    min-height: 100vh;
+    overflow: hidden;
+}
+.content {
     background: rgba(0, 0, 0, .4);
     display: flex;
     flex-direction: column;
     justify-content: center;
     align-items: center;
+    z-index: 100;
+    padding: 100rpx 0;
+    min-height: 100vh;
 
     .save-btn {
         margin-top: 35rpx;
@@ -191,4 +206,8 @@ export default {
         border-radius: 50rpx;
     }
 }
+.big-canvas{
+    opacity: 0;
+    z-index: 0;
+}
 </style>

+ 200 - 0
src/pagesC/settledMerchant/balanceLog.vue

@@ -0,0 +1,200 @@
+<template>
+  <view class="container">
+    <!-- 顶部导航 -->
+    <view class="Tab_con flex_r flex_ac flex_jb">
+      <view
+        class="tab_list flex_r flex_ac"
+        :class="current == index ? 'active' : ''"
+        v-for="(item, index) in TabList"
+        :key="index"
+        @tap="SetStatus(index)"
+        >{{ item.title }}</view
+      >
+    </view>
+    <!-- 顶部导航-end -->
+    <!-- 资金列表 -->
+    <view class="con">
+      <view class="list" v-for="(item, index) in list" :key="index">
+        <view class="list_head flex_r flex_ac flex_jb">
+          <view class="head_name">{{ item.remark }}</view>
+          <view :class="['head_price',item.act == '+' ? 'g_color' : '']">{{ item.act }}{{item.num }}</view>
+        </view>
+        <view class="list_con flex_r flex_ac flex_jb">
+          <view class="list_time">{{ item.create_time }}</view>
+          <view class="list_balance">余额{{ item.after }}</view>
+        </view>
+      </view>
+      <not-goods v-if="haveGoods" textStr="暂无流水信息"></not-goods>
+    </view>
+    <!-- 资金列表 -->
+  </view>
+</template>
+<script>
+let page = 1;
+import { post } from "@/request/api.js";
+import notGoods from "@/components/not-goods/index.vue";
+export default {
+  components: {
+    notGoods,
+  },
+  data() {
+    return {
+      haveGoods: false, // 是否有商品
+      current: 0,
+      TabList: [
+        { title: "全部", sauts: 0 },
+        { title: "收益", sauts: 1 },
+        { title: "支出", sauts: 2 },
+      ],
+      list: [],
+      page:1
+    };
+  },
+  onLoad(da) {
+    this.current = da.s || 0
+  },
+  onShow() {
+    this.page = 1;
+    this.list = [];
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      let data = {
+        page: this.page,
+        rows:20,
+        type_id: this.current,
+      };
+      uni.showLoading({ mask: true });
+      post("v1/merchant/commission", data).then((res) => {
+        uni.hideLoading();
+        if (res.code === 0) {
+          if (res.data.data.length > 0) {
+            this.list = this.list.concat(res.data.data);
+          } else {
+            if (this.page == 1) {
+              this.haveGoods = true;
+              this.page = -1;
+            } else {
+              this.page = -1;
+              this.$toast("暂无更多");
+            }
+          }
+        } else {
+          if (page == 1) {
+            this.haveGoods = true;
+            this.page = -1;
+          } else {
+            this.page = -1;
+            this.$toast("暂无更多");
+          }
+        }
+      });
+    },
+    SetStatus(i) {
+      this.current = i;
+      this.page = 1;
+      this.list = [];
+      this.haveGoods = false;
+      this.loadData();
+    },
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+    if (this.page != -1) {
+      setTimeout(function () {
+        ++this.page;
+        this.loadData();
+      }, 800);
+    }
+  },
+};
+</script>
+<style lang="scss">
+// 页面配置
+// 页面配置-end
+
+// 顶部列表
+.tab_list {
+  height: 100%;
+  box-sizing: border-box;
+  font-size: 30rpx;
+  color: #808080;
+}
+
+.Tab_con {
+  width: 100%;
+  height: 92rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+}
+
+.active {
+  color: #1bbd89;
+  border-bottom: 6rpx solid #1bbd89;
+}
+
+// 顶部列表-end
+
+// 资金列表
+.con {
+  border-top: 16rpx solid #f4f4f4;
+}
+
+.list_con {
+  width: 100%;
+  overflow: hidden;
+}
+
+.list_head {
+  width: 100%;
+  overflow: hidden;
+  margin-bottom: 5rpx;
+}
+
+.list_time {
+  font-size: 24rpx;
+  color: #a1a1a1;
+}
+
+.list_balance {
+  font-size: 24rpx;
+  color: #a1a1a1;
+}
+
+.head_price {
+  font-size: 32rpx;
+  font-family: "SourceHanSansCN-Medium";
+}
+
+.head_name {
+  font-size: 30rpx;
+  color: #212121;
+  font-family: "SourceHanSansCN-Medium";
+}
+
+.list {
+  width: 100%;
+  overflow: hidden;
+  padding: 30rpx;
+  box-sizing: border-box;
+  border-bottom: 3rpx solid #f4f4f4;
+}
+
+// 资金列表-end
+
+// 状态颜色
+.g_color {
+  color: #1bbd89;
+}
+
+.y_color {
+  color: #f15b21;
+}
+
+// 状态颜色-end
+</style>

+ 21 - 12
src/pagesC/settledMerchant/myShop.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="myshop">
         <div class="card">
-            <div class="money">¥{{money.withdraw_money || "0.00"}}</div>
+            <div class="money" @click="goto('/pagesC/settledMerchant/balanceLog',{s:0})">¥{{money.withdraw_money || "0.00"}}</div>
             <div class="msg">可提现金额(元)</div>
             <div class="btn">
                 <span>去提现</span>
@@ -9,8 +9,8 @@
             </div>
         </div>
         <div class="elseMoney flex_r flex_jb flex_ac">
-            <div class="total_money">总收入<span>¥{{money.total_money || "0.00"}}</span></div>
-            <div class="day_income">今日收入<span>¥{{money.day_income || "0.00"}}</span></div>
+            <div class="total_money" @click="goto('/pagesC/settledMerchant/balanceLog',{s:1})">总收入<span>¥{{money.total_money || "0.00"}}</span></div>
+            <div class="day_income" @click="goto('/pagesC/settledMerchant/balanceLog',{s:1})">今日收入<span>¥{{money.day_income || "0.00"}}</span></div>
         </div>
         <div class="list" v-if="list.length">
             <div class="list-item" v-for="(i,s) in list" :key="s">
@@ -25,13 +25,13 @@
                     </div>
                     <div class="twocode iconfont" @click="showcode({id:i.merchant_id,name:i.name})">&#xe635;</div>
                 </div>
-                <div class="p1 flex_r">
+                <div class="p1 flex_r flex_jb flex_ac">
                     <div class="l"><span class="iconfont">&#xe9d2;</span>业务员:{{i.nickname}}</div>
-                    <div class="r"><span class="iconfont">&#xe9d3;</span>电话:{{i.mobile}}</div>
+                    <div class="r" @click="copyText(i.mobile)"><span class="iconfont">&#xe9d3;</span>电话:{{i.mobile}}<span class="iconfont copy">&#xe602;</span></div>
                 </div>
-                <div class="p1 flex_r" v-if="i.user_nickname">
+                <div class="p1 flex_r flex_jb flex_ac" v-if="i.user_nickname">
                     <div class="l"><span class="iconfont">&#xe9b9;</span>区域商:{{i.user_nickname}}</div>
-                    <div class="r"><span class="iconfont">&#xe9d3;</span>电话:{{i.user_mobile}}</div>
+                    <div class="r" @click="copyText(i.user_mobile)"><span class="iconfont">&#xe9d3;</span>电话:{{i.user_mobile}}<span class="iconfont copy">&#xe602;</span></div>
                 </div>
             </div>
         </div>
@@ -40,6 +40,7 @@
     </div>
 </template>
 <script>
+import uniCopy from "@/utils/copy";
 import empty from "@/pagesC/components/empty/empty"
 import createCode from "@/pagesC/components/createCode/index"
 import { post } from "@/request/api.js";
@@ -67,7 +68,15 @@ export default {
         },
         showcode(da) {
             this.$refs.createCode.showCanvas(da)
-        }
+        },
+        // 复制账号
+        copyText(e) {
+            uniCopy({
+                content: e,
+                success: (res) => {},
+                error: (e) => {},
+            });
+        },
     },
     onLoad(da) {
         this.getList()
@@ -193,15 +202,15 @@ export default {
         font-size: 26rpx;
         margin-top: 20rpx;
 
-        div {
-            width: 50%;
-        }
-
         .iconfont {
             font-size: 26rpx;
             color: #2E57FD;
             margin-right: 10rpx;
         }
+        .copy{
+            color: #333;
+            margin-left: 6rpx;
+        }
     }
 }
 </style>

+ 2 - 0
src/pagesC/settledMerchant/pay.vue

@@ -22,6 +22,8 @@
 </template>
 
 <script>
+import { ToPayOpre } from "@/utils/reqTools.js";
+let toPayOpre = new ToPayOpre();
 import { post } from "@/request/api.js";
 export default {
     name: "pay",

+ 4 - 4
src/request/config.js

@@ -6,10 +6,10 @@ if (process.env.UNI_PLATFORM === "h5") {
 	//develop/开发版	trial/体验版	release/正式版
 	const accountInfo = wx.getAccountInfoSync();
 	let envV = accountInfo.miniProgram.envVersion;
-	// if (envV === "release") apis = 1
-	// else apis = 0
-	if (envV === "develop") apis = 0
-	else apis = 1
+	if (envV === "release") apis = 1
+	else apis = 0
+	// if (envV === "develop") apis = 0
+	// else apis = 1
 }
 
 export default apis == 1 ? {