Jelajahi Sumber

商家入驻

DaMowang 2 tahun lalu
induk
melakukan
4fa37f97f8

+ 4 - 4
src/app.scss

@@ -47,10 +47,10 @@ view,text,div {
 /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
 @font-face {
     font-family: 'iconfont';  /* Project id 3748689 */
-    src: url('//at.alicdn.com/t/c/font_3748689_egyerbpmrbl.woff2?t=1701245595289') format('woff2'),
-         url('//at.alicdn.com/t/c/font_3748689_egyerbpmrbl.woff?t=1701245595289') format('woff'),
-         url('//at.alicdn.com/t/c/font_3748689_egyerbpmrbl.ttf?t=1701245595289') format('truetype');
-  }
+    src: url('//at.alicdn.com/t/c/font_3748689_9skur541wqr.woff2?t=1701678660669') format('woff2'),
+         url('//at.alicdn.com/t/c/font_3748689_9skur541wqr.woff?t=1701678660669') format('woff'),
+         url('//at.alicdn.com/t/c/font_3748689_9skur541wqr.ttf?t=1701678660669') format('truetype');
+}
 
 .iconfont {
     font-family: "iconfont" !important;

+ 0 - 0
src/pagesB/components/h-address/address.vue → src/components/h-address/address.vue


+ 13 - 9
src/pages.json

@@ -12,14 +12,12 @@
 				"navigationBarTitleText": "福利"
 			}
 		},
-		// {
-		// 	"path": "pages/orderingfood/merchantlist",
-		// 	"style": {
-		// 		"navigationBarTitleText": "数智生活",
-		// 		"onReachBottomDistance": 200,
-		// 		"navigationStyle": "custom"
-		// 	}
-		// },
+		{
+			"path": "pages/settledMerchant/index",
+			"style": {
+				"navigationBarTitleText": "快捷买单"
+			}
+		},
 		{
 			"path": "pages/my/index",
 			"style": {
@@ -525,7 +523,7 @@
 		}
 	],
 	"preloadRule": {
-		"pages/my/index": {
+		"pages/index/index": {
 			"network": "all",
 			"packages": [ "pagesB", "pagesC" ]
 		}
@@ -542,6 +540,12 @@
 				"selectedIconPath": "static/nav/home.png",
 				"text": "首页"
 			},
+			{
+				"pagePath": "pages/settledMerchant/index",
+				"iconPath": "static/nav/local_.png",
+				"selectedIconPath": "static/nav/local.png",
+				"text": "快捷买单"
+			},
 			{
 				"pagePath": "pages/sign/index",
 				"iconPath": "static/nav/benefits_.png",

+ 55 - 58
src/pages/index/index.vue

@@ -18,12 +18,11 @@
                 </swiper>
             </view>
             <!-- 公告-end -->
-            
             <!-- 专区入口 -->
             <div class="l_tabBar flex_r flex_jb">
                 <div class="search-box flex_r flex_jb flex_ac">
-                    <div class="district">
-                        <span>深圳</span>
+                    <div class="district" @click="showAddress = !showAddress">
+                        <span>{{ LocationCity }}</span>
                         <span class="iconfont">&#xe62f;</span>
                     </div>
                     <div class="search flex_r flex_jb flex_ac">
@@ -31,15 +30,14 @@
                         <input v-model="searchKey" @confirm="toSearch" class="inp" placeholder="搜索你要的内容">
                         <span class="search_btn" @click="toSearch">搜索</span>
                     </div>
-                    <div class="scan-ico iconfont">&#xe8cf;</div>
+                    <!-- <div class="scan-ico iconfont">&#xe8cf;</div> -->
                 </div>
-                <div class="item" v-for="(i,s) in tabs" :key="s" @click="isActivation(i.url)">
+                <div class="item" v-for="(i,s) in tabs" :key="s" @click="goto(i.url)">
                     <img :src="i.ico" alt="" class="ico">
                     <!-- <div class="tit">{{ i.tit }}</div> -->
                 </div>
             </div>
             <!-- 专区-end -->
-
             <!-- 活动 -->
             <view class="activity" v-if="homeImg.length">
                 <image class="act_img act_one_img" :src="homeImg[0].image" @click="setPageUrl({ type: 4 })" mode=""></image>
@@ -50,14 +48,12 @@
             </view>
             <!-- 活动-end -->
         </view>
-        
         <view class="bou_head flex_r flex_ac flex_jc">
             <image class="bou_img" src="/static/sgin/left.png" mode=""></image>
             <view class="bou_title">今日推荐</view>
             <image class="bou_img" src="/static/sgin/right.png" mode=""></image>
         </view>
         <view class="list_bar">
-            <!-- <div class="tit">猜你喜欢</div> -->
             <view class="product-list">
                 <view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
                     <view class="image-view">
@@ -89,41 +85,45 @@
             </view>
         </view>
         <view class="fz_w_text">让数字经济赋能美好生活!</view>
-		<xh-privacy title="隐私保护指引" color="#18bb88"></xh-privacy>
-        <activation ref="activation" tit="激活" :close="isActivation"/>
-
+        <!-- 隐私指引 -->
+        <xh-privacy title="隐私保护指引" color="#18bb88"></xh-privacy>
+        <!-- 城市选择 -->
+        <h-address @select="selectaddress" :visible.sync="showAddress" />
     </div>
 </template>
 <script>
 import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
-import activation from "@/components/activation/activation.vue";
-import xhPrivacy from "@/components/xh-privacy/xh-privacy.vue";
+import xhPrivacy from "@/components/xh-privacy/xh-privacy.vue"; //隐私保护指引
+import hAddress from "@/components/h-address/address.vue"; //城市选择
+import tabs from '@/static/js/tabs' //专区入口
 import { post } from "@/request/api.js";
-import tabs from '@/pages/orderingfood/tabs.js'
 export default {
     name: "Appindex",
     components: {
         swiperBanner, //轮播
-        activation,
-        xhPrivacy
+        xhPrivacy,
+        hAddress
     },
     data() {
         return {
-            BannerImg: [],  // 轮播图列表
-            not_list: [],   // 公告列表
-            homeImg: "",    //活动列表
+            BannerImg: [], // 轮播图列表
+            not_list: [], // 公告列表
+            homeImg: "", //活动列表
             productList: [], //商品数据
             searchKey: "", //搜索关键词
+            LocationCity: "深圳",
+            showAddress: false,
             tabs
         };
     },
-    onLoad(option) {},
-    onLaunch() {},
+    onLoad(option) {
+        this.getToCity()
+    },
     onShow() {
         this.loadData();
         this.getBanner(); //获取轮播图
         this.getAnnounce(); //获取公告列表
-        this.gethomeImg();  //活动列表
+        this.gethomeImg(); //活动列表
     },
     onHide() {},
     methods: {
@@ -175,44 +175,31 @@ export default {
         },
         // 轮播图跳转
         goList(e) {},
-        goVipGift(){
+        goVipGift() {
             this.goto("/pages/product/productRetail", { type: 4, is_vip: 1 });
         },
-        toSearch(){
+        // 搜索
+        toSearch() {
             this.goto("/pagesC/settledMerchant/index", { key: this.searchKey });
         },
-        // 是否激活数智生活
-        isActivation(url) {
-            uni.Location();
-            post("local/isActivation").then(res => {
-                if (res.code === 0) {
-                    this.goto(url)
-                    // uni.Luserfun()
-                } else if (res.code == -1) {
-                    this.$toast("请先登录或注册!");
-                    // this.activation();
+        // 获取当前城市
+        async getToCity() {
+            let { lat, lng } = await uni.Location();
+            post("local/hotel/city", { longitude: lng, latitude: lat }).then(res => {
+                if (res.code == 0) {
+                    let da = res.data
+                    this.LocationCity = da.cityName;
                 }
             })
         },
-        // 打开激活弹窗
-        activation(){
-            this.$refs.activation.open()
+        // 选择城市
+        selectaddress(da) {
+            this.LocationCity = da.cityName;
+            this.showAddress = false;
         },
     },
     computed: {},
     watch: {},
-    onShareAppMessage() {
-        let userinfo = uni.getStorageSync("userinfo");
-        var path = "/pages/index/index";
-        if (userinfo.invite) {
-            path = "/pages/index/index?invite=" + userinfo.invite;
-        }
-        var title = `让数字经济赋能美好生活!`;
-        return {
-            title: title,
-            path: path,
-        };
-    },
 };
 </script>
 <style scoped lang='scss'>
@@ -285,33 +272,41 @@ export default {
     border-radius: 10rpx;
     box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
     flex-wrap: wrap;
-    .search-box{
+
+    .search-box {
         width: 100%;
         padding: 10rpx;
         margin-bottom: 12rpx;
-        .district{
+
+        .district {
             font-size: 32rpx;
             font-weight: 600;
             color: #333;
-            .iconfont{
+
+            .iconfont {
                 font-size: 20rpx;
                 margin-left: 12rpx;
             }
         }
-        .search{
+
+        .search {
             border: 1px solid #D78C2E;
             height: 60rpx;
             line-height: 60rpx;
             padding-left: 20rpx;
             border-radius: 31rpx;
-            .iconfont{
+
+            .iconfont {
                 font-size: 30rpx;
             }
-            .inp{
+
+            .inp {
                 font-size: 25rpx;
                 padding: 0 8rpx;
+                width: 300rpx;
             }
-            .search_btn{
+
+            .search_btn {
                 background-color: #D78C2E;
                 height: 100%;
                 color: #fff;
@@ -320,7 +315,8 @@ export default {
                 padding: 0 28rpx;
             }
         }
-        .scan-ico{
+
+        .scan-ico {
             font-size: 55rpx;
         }
     }
@@ -482,7 +478,8 @@ export default {
             margin-right: 6rpx;
         }
     }
-    .product-price-msg{
+
+    .product-price-msg {
         font-size: 20rpx;
         color: #ff6d44;
     }

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

@@ -12,7 +12,7 @@
         </view>
         <view class="invi_tops"><text space="nbsp">新用户扫二维码识别小程序 / 授权登录即可成功绑定关系</text></view>
         <view class="btn_group disFlex_goodsBox flex_hor_between" v-if="bgImgList && bgImgList.length > 0">
-            <view class="btn_tab" @tap="getImg" v-if="flag">生成专属海报</view>
+            <view class="btn_tab" @tap="getImg">生成专属海报</view>
         </view>
         <canvas class="myCanvas" canvas-id="myCanvas" :style="'width:' + WIDTH + 'px;height:' + HEIGHT + 'px;'"></canvas>
     </view>
@@ -26,7 +26,6 @@ export default {
             WIDTH: 1080,
             HEIGHT: 1848,
             E_WIDTH: 290,
-            flag: true,
             imgUrl: "",
             bgImgList: [],
             bgSrc: "",
@@ -171,6 +170,7 @@ export default {
         },
 
         savefun(path) {
+            let that =  this
             uni.saveImageToPhotosAlbum({
                 filePath: path,
                 success(result) {
@@ -186,8 +186,7 @@ export default {
                     });
                 },
                 fail(result) {
-                    this.flag = false;
-                    this.$toast("保存失败");
+                    that.$toast("保存失败");
                 },
             });
         },

+ 0 - 303
src/pages/orderingfood/merchantlist.vue

@@ -1,303 +0,0 @@
-<template>
-    <div class="merchantlist">
-        <div class="head">
-            <div class="bg" v-if="IsMobile"></div>
-            <div class="card" :style="{marginTop:IsMobile?'-110rpx':'30rpx'}">
-                <div class="live_name">{{ typeto(localInfo.level_id) }}</div>
-                <view class="regional">
-                    <template v-if="localInfo.regional">
-                        <img src="@/static/my/regional.png" alt="" srcset="" class="ico">
-                        <!-- <span class="ico iconfont">&#xf727;</span> -->
-                        <span class="txtinfo">区域节点:{{ localInfo.regional }}</span>
-                    </template>
-                </view>
-                <div class="mm">
-                    <span>账户余额</span>
-                    <span class="balance dinB">{{ localInfo.integral || 0 }}</span>
-                </div>
-            </div>
-        </div>
-        <div class="l_tabBar flex_r flex_jb">
-            <div class="item" v-for="(i,s) in tabs" :key="s" @click="goto(i.url)">
-                <img :src="i.ico" alt="" class="ico">
-                <!-- <div class="tit">{{ i.tit }}</div> -->
-            </div>
-        </div>
-        <view class="loadingBox" v-if="loading">
-            <img class="loading" src="http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/2caa2ae4dc849856f3eca4ff2b3abf7fd19e7632gif" />
-        </view>
-        <div class="list" v-else>
-            <div class="li_item" v-for="(i,s) in merchantList" :key="s" @click="goMerchant(i)">
-                <div class="li_title">{{ i.brand_name }}</div>
-                <div class="logo_img">
-                    <img :src="i.restaurant_img" alt="">
-                </div>
-                <div class="con_box">
-                    <div class="p1 ellipsis">{{ i.restaurant_name }}</div>
-                    <div class="p2">{{ i.restaurant_address }}</div>
-                    <div class="p3">{{ $h.Div(i.distance, 1000).toFixed(2) }} km</div>
-                </div>
-            </div>
-        </div>
-        <activation ref="activation" tit="激活" :close="isActivation"/>
-    </div>
-</template>
-<script>
-import activation from "@/components/activation/activation.vue"
-import tabs from './tabs'
-import { post } from "@/request/api.js";
-export default {
-    name: "merchantlist",
-    props: {},
-    components: { activation },
-    data() {
-        return {
-            IsMobile: true,
-            loading: true,
-            Query: {
-                lat: 113.9367,
-                lng: 22.5325,
-                page: 1,
-                rows: 20
-            },
-            merchant: {},
-            merchantList: [],
-            localInfo: {},
-            tabs,
-        };
-    },
-    methods: {
-        // 获取附近商家
-        getlists() {
-            post("local/getMerchant", this.Query).then(res => {
-                if (res.code == 0) {
-                    this.loading = false
-                    let merchantList = res.data.data
-                    delete res.data.data
-                    this.merchant = res.data
-                    this.merchantList = [...this.merchantList, ...merchantList]
-                    this.Query.page++
-                }
-            })
-        },
-        // 获取当前位置
-        async getLocation() {
-            let adres = await uni.Location();
-            this.Query = { ...this.Query, ...adres };
-            this.getlists();
-        },
-        // 去店铺
-        goMerchant(da) {
-            uni.setStorageSync("MerchantItem", da)
-            this.goto("/pagesB/orderingfood/orderingfood", {
-                brand_id: da.brand_id,
-                restaurant_id: da.restaurant_id
-            })
-        },
-        // 是否激活数智生活
-        isActivation() {
-            post("local/isActivation").then(res => {
-                if (res.code == -1) {
-                    this.activation();
-                } else {
-                    this.getLocation();
-                    this.getLU();
-                }
-            })
-        },
-        // 打开激活弹窗
-        activation(){
-            this.$refs.activation.open()
-        },
-        async getLU() {
-            this.localInfo = await uni.Luserfun()
-        },
-        typeto(va) {
-            switch (va) {
-                case 1: return "消费商";
-                case 2: return "推广大使";
-                case 3: return "合伙人";
-                case 4: return "联合创始人";
-                case 5: return "联合发起人";
-                default: return ""
-            }
-        }
-    },
-    onLoad(da){
-        let app = uni.getSystemInfoSync();
-        if(["android","ios","devtools"].includes(app.platform)){
-            this.IsMobile = true
-        }else this.IsMobile = false
-    },
-    onShow() {
-        this.isActivation();
-    },
-    onReachBottom() {
-        if (this.Query.page < this.merchant.last_page) this.getlists();
-    },
-};
-</script>
-<style scoped lang='scss'>
-.head {
-    .bg {
-        height: 300rpx;
-        background-image: url("http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/a5500a3c12f967a83d123f774b333e2b2d9729bcpng");
-        background-size: 100% 100%;
-    }
-
-    .card {
-        width: calc(100% - 60rpx);
-        margin: -110rpx 30rpx 0;
-        // background-color: #473D31;
-        background: url("http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/33ce780a63d0cedd92868b1784a355d2bfaad827jpg");
-        background-size: 100% 100%;
-        border-radius: 16rpx;
-        padding: 28rpx 30rpx;
-        height: 280rpx;
-        position: relative;
-
-        .balance {
-            font-size: 46rpx;
-            margin-top: 8rpx;
-            margin-left: 26rpx;
-
-            &:before {
-                content: "¥";
-                font-size: 24rpx;
-            }
-        }
-
-        .live_name {
-            font-size: 36rpx;
-            color: #CD7C2B;
-            position: absolute;
-            top: 16rpx;
-            left: 90rpx;
-
-        }
-
-        .mm {
-            margin: auto 0;
-            text-align: center;
-            line-height: 98rpx;
-        }
-    }
-    .regional {
-        height: 30rpx;
-        line-height: 30rpx;
-        margin-top: 40rpx;
-        
-        
-        // .ico {
-        //     font-size: 26rpx;
-        //     margin-right: 12rpx;
-        // }
-
-        .ico {
-            width: 32rpx;
-            height: 32rpx;
-            margin-right: 12rpx;
-        }
-
-        .txtinfo {
-            font-size: 22rpx;
-            color: #333;
-        }
-        .ico, .txtinfo {
-            vertical-align: middle;
-        }
-    }
-}
-
-.list {
-    padding: 30rpx;
-
-    .li_item {
-        margin-bottom: 20rpx;
-        padding: 28rpx 32rpx;
-        background-color: #fff;
-        border-radius: 10rpx;
-        box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
-    }
-
-    .li_title {
-        font-size: 36rpx;
-        margin-bottom: 16rpx;
-    }
-
-    .logo_img,
-    .con_box {
-        display: inline-block;
-        vertical-align: top;
-    }
-
-    .logo_img {
-        img {
-            height: 180rpx;
-            width: 180rpx;
-            border-radius: 10rpx;
-        }
-    }
-
-    .con_box {
-        height: 180rpx;
-        width: calc(100% - 180rpx - 28rpx);
-        margin-left: 28rpx;
-        position: relative;
-
-        .p1 {
-            font-size: 32rpx;
-            font-weight: bold;
-            color: #333;
-            margin-bottom: 6rpx;
-        }
-
-        .p2 {
-            font-size: 24rpx;
-            color: #999;
-        }
-
-        .p3 {
-            font-size: 24rpx;
-            color: #666;
-            position: absolute;
-            right: 0;
-            bottom: 0;
-        }
-    }
-}
-
-.l_tabBar {
-    margin: 32rpx 32rpx 0;
-    background-color: #fff;
-    padding: 10rpx 20rpx;
-    border-radius: 10rpx;
-    box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
-    flex-wrap: wrap;
-
-    .item {
-        width: 105rpx;
-        margin: 10rpx 10rpx;
-    }
-
-    .ico {
-        width: 100%;
-        height: 138rpx;
-    }
-
-    // .tit{
-    //   font-size: 26rpx;
-    //   text-align: center;
-    // }
-}
-
-.loadingBox {
-    text-align: center;
-    padding: 100rpx 0;
-
-    .loading {
-        width: 280rpx;
-        height: 280rpx;
-    }
-}
-</style>

+ 4 - 4
src/pages/product/p_details.vue

@@ -60,9 +60,6 @@
             <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">
@@ -104,6 +101,9 @@
             </view>
         </uni-popup>
         <!-- 购买或加入购物车弹窗-end -->
+        <!-- 授权 -->
+        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
+        <!-- 授权-end -->
     </view>
 </template>
 <script>
@@ -484,9 +484,9 @@ page {
 
 // 底部导航组件
 .option {
-    position: fixed;
     width: 100%;
     overflow: hidden;
+    position: fixed;
     left: 0;
     bottom: 0;
 }

+ 216 - 0
src/pages/settledMerchant/index.vue

@@ -0,0 +1,216 @@
+<template>
+    <div class="settledMerchantList">
+        <div class="search-box flex_r flex_jb flex_ac">
+            <div class="district" @click="showAddress = !showAddress">
+                <span>{{ LocationCity }}</span>
+                <span class="iconfont">&#xe62f;</span>
+            </div>
+            <div class="search flex_r flex_jb flex_ac">
+                <span class="iconfont">&#xe661;</span>
+                <input v-model="Query.name" @confirm="navSearch" class="inp" placeholder="搜索你要的内容">
+                <span class="search_btn" @click="navSearch">搜索</span>
+            </div>
+            <!-- <div class="scan-ico iconfont">&#xe8cf;</div> -->
+        </div>
+        <div class="list" v-if="list.length">
+            <div class="li_item" v-for="(i,s) in list" :key="s" @click="goMerchant(i)">
+                <div class="logo_img">
+                    <img :src="i.logo" alt="">
+                </div>
+                <div class="con_box">
+                    <div class="p1 ellipsis">{{ i.name }}</div>
+                    <div class="p2">{{ i.address }}</div>
+                    <div class="p3">{{ $h.Div(i.distance, 1000).toFixed(2) }} km</div>
+                </div>
+            </div>
+        </div>
+        <!-- 城市选择 -->
+        <h-address @select="selectaddress" :visible.sync="showAddress" />
+    </div>
+</template>
+<script>
+import hAddress from "@/components/h-address/address.vue"; //城市选择
+import { post } from "@/request/api.js";
+export default {
+    name: "settledMerchantList",
+    props: {},
+    components: { hAddress },
+    data() {
+        return {
+            list: [],
+            Query: {
+                latitude: 113.9367,
+                longitude: 22.5325,
+                page: 1,
+                rows: 20
+            },
+            pageData: {},
+            LocationCity: "深圳",
+            showAddress: false,
+        };
+    },
+    methods: {
+        goMerchant(da) {
+            this.setLS("merchant", da)
+            this.goto("/pagesC/settledMerchant/merchant", { id: da.id })
+        },
+        // 获取当前位置
+        async getLocation() {
+            let adres = await uni.Location();
+            this.Query.longitude = adres.lng;
+            this.Query.latitude = adres.lat;
+        },
+        getList(page) {
+            if (page) {
+                this.list = []
+                this.Query.page = 1
+            }
+            post("v1/merchant/list", this.Query).then(res => {
+                if (res.code == 0) {
+                    let da = res.data.data
+                    delete res.data.data
+                    this.pageData = res.data
+                    this.list = [...this.list, ...da]
+                    this.Query.page++
+                }
+            })
+        },
+        // 搜索
+        navSearch() {
+            if (!this.Query.name) delete this.Query.name
+            this.getList(1);
+        },
+        // 获取当前城市
+        async getToCity() {
+            let { lat, lng } = await uni.Location();
+            post("local/hotel/city", { longitude: lng, latitude: lat }).then(res => {
+                if (res.code == 0) {
+                    let da = res.data
+                    this.LocationCity = da.cityName;
+                }
+            })
+        },
+        // 选择城市
+        selectaddress(da) {
+            this.LocationCity = da.cityName;
+            this.showAddress = false;
+        },
+    },
+    onLoad(da) {
+        this.getLocation();
+        this.getList();
+        this.getToCity();
+    },
+    onShow() {},
+    mounted() {},
+    onReachBottom() {
+        if (this.Query.page < this.pageData.last_page) this.getList();
+    },
+};
+</script>
+<style scoped lang='scss'>
+.search-box {
+    width: 100%;
+    padding: 10rpx 32rpx;
+
+    .district {
+        font-size: 32rpx;
+        font-weight: 600;
+        color: #333;
+
+        .iconfont {
+            font-size: 20rpx;
+            margin-left: 12rpx;
+        }
+    }
+
+    .search {
+        border: 1px solid #D78C2E;
+        height: 60rpx;
+        line-height: 60rpx;
+        padding-left: 20rpx;
+        border-radius: 31rpx;
+
+        .iconfont {
+            font-size: 30rpx;
+        }
+
+        .inp {
+            font-size: 25rpx;
+            padding: 0 8rpx;
+            width: 336rpx;
+        }
+
+        .search_btn {
+            background-color: #D78C2E;
+            height: 100%;
+            color: #fff;
+            border-radius: 31rpx;
+            font-size: 28rpx;
+            padding: 0 28rpx;
+        }
+    }
+
+    .scan-ico {
+        font-size: 55rpx;
+    }
+}
+
+.list {
+    padding: 30rpx;
+
+    .li_item {
+        margin-bottom: 20rpx;
+        padding: 28rpx 32rpx;
+        background-color: #fff;
+        border-radius: 10rpx;
+        box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
+    }
+
+    .li_title {
+        font-size: 36rpx;
+        margin-bottom: 16rpx;
+    }
+
+    .logo_img,
+    .con_box {
+        display: inline-block;
+        vertical-align: top;
+    }
+
+    .logo_img {
+        img {
+            height: 180rpx;
+            width: 180rpx;
+            border-radius: 10rpx;
+        }
+    }
+
+    .con_box {
+        height: 180rpx;
+        width: calc(100% - 180rpx - 28rpx);
+        margin-left: 28rpx;
+        position: relative;
+
+        .p1 {
+            font-size: 32rpx;
+            font-weight: bold;
+            color: #333;
+            margin-bottom: 6rpx;
+        }
+
+        .p2 {
+            font-size: 24rpx;
+            color: #999;
+        }
+
+        .p3 {
+            font-size: 24rpx;
+            color: #666;
+            position: absolute;
+            right: 0;
+            bottom: 0;
+        }
+    }
+}
+</style>

+ 1 - 1
src/pagesB/hotel/index.vue

@@ -73,7 +73,7 @@
 </template>
 <script>
 import DatePicker from "@/pagesB/components/date-picker/date-picker.vue";
-import hAddress from "@/pagesB/components/h-address/address.vue";
+import hAddress from "@/components/h-address/address.vue";
 import nniSlider from "@/pagesB/components/nni-slider/slider.vue";
 import QQMapWX from '@/pagesB/static/js/qqmap-wx-jssdk.min.js';
 const showmap = new QQMapWX({ key: 'K7LBZ-RE23Q-JEN5D-4ZNEI-MS54Q-BHF6D' });

+ 1 - 1
src/pagesB/scenicSpotTicket/index.vue

@@ -57,7 +57,7 @@
     </div>
 </template>
 <script>
-import hAddress from "@/pagesB/components/h-address/address.vue";
+import hAddress from "@/components/h-address/address.vue";
 import { post } from "@/request/api.js";
 import QQMapWX from '@/pagesB/static/js/qqmap-wx-jssdk.min.js';
 const showmap = new QQMapWX({ key: 'K7LBZ-RE23Q-JEN5D-4ZNEI-MS54Q-BHF6D' });

+ 194 - 0
src/pagesC/components/createCode/index.vue

@@ -0,0 +1,194 @@
+<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="save-btn" @click.stop="saveImage" v-if="!isLoading">保存图片</view>
+        <image id="Image" :src="qrcode" v-show="false"></image>
+    </view>
+</template>
+<script>
+import { post } from "@/request/api.js";
+export default {
+    props: {},
+    data() {
+        return {
+            canvasW: 0,
+            canvasH: 0,
+            ctx: null,
+            isShow: false,
+            isLoading: true,
+            title: "草莓千层蛋糕",
+            qrcode: 'https://oss.zhangyubk.com/cmqrcode.jpg',
+            headerImg: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/268c896c47298c7c79a8270c36076741e8f15b0fjpg"
+        }
+    },
+    methods: {
+        //显示
+        showCanvas(da) {
+            this.isShow = true
+            this.title = da.name
+            this.isLoading = true
+            uni.showLoading({
+                title: '加载中...',
+                mask: true
+            })
+            this.getQrcode(da.id)
+        },
+        // 获取商家码
+        async getQrcode(merchant_id){
+            let res = await post("v1/merchant/xcxqrcode",{merchant_id})
+            if(res.code == 0) {
+                console.log(res.data);
+                this.qrcode = res.data;
+                this.__init()
+            }
+        },
+        //初始化画布
+        async __init() {
+            this.ctx = uni.createCanvasContext('my-canvas', this)
+            this.canvasW = uni.upx2px(600);
+            this.canvasH = uni.upx2px(820);
+            //设置画布背景透明
+            this.ctx.setFillStyle('rgba(255, 255, 255, 0)')
+            //设置画布大小
+            this.ctx.fillRect(0, 0, this.canvasW, this.canvasH)
+            //绘制圆角背景
+            this.drawRoundRect(this.ctx, 0, 0, this.canvasW, this.canvasH, uni.upx2px(18), '#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.ctx.setFontSize(14); //设置标题字体大小
+            this.ctx.setFillStyle('#333'); //设置标题文本颜色
+            this.ctx.textAlign = 'center';
+            this.ctx.fillText(this.title, (this.canvasW / 2), this.canvasH - 135)
+            //小程序码
+            let qrcodeImg = await this.getImageInfo(this.qrcode)
+            this.ctx.drawImage(qrcodeImg.path, 73, 93, 158, 158)
+            //延迟渲染
+            setTimeout(() => {
+                this.ctx.draw(true, () => {
+                    this.isLoading = false
+                    uni.hideLoading()
+                })
+            }, 500)
+        },
+        //带圆角图片
+        drawRoundImg(ctx, img, x, y, width, height, radius) {
+            ctx.beginPath()
+            ctx.save()
+            // 左上角
+            ctx.arc(x + radius, y + radius, radius, Math.PI, Math.PI * 1.5)
+            // 右上角
+            ctx.arc(x + width - radius, y + radius, radius, Math.PI * 1.5, Math.PI * 2)
+            // 右下角
+            ctx.arc(x + width - radius, y + height - radius, radius, 0, Math.PI * 0.5)
+            // 左下角
+            ctx.arc(x + radius, y + height - radius, radius, Math.PI * 0.5, Math.PI)
+            ctx.stroke()
+            ctx.clip()
+            ctx.drawImage(img, x, y, width, height);
+            ctx.restore()
+            ctx.closePath()
+        },
+        //圆角矩形
+        drawRoundRect(ctx, x, y, width, height, radius, color) {
+            ctx.save();
+            ctx.beginPath();
+            ctx.setFillStyle(color);
+            ctx.setStrokeStyle(color)
+            ctx.setLineJoin('round'); //交点设置成圆角
+            ctx.setLineWidth(radius);
+            ctx.strokeRect(x + radius / 2, y + radius / 2, width - radius, height - radius);
+            ctx.fillRect(x + radius, y + radius, width - radius * 2, height - radius * 2);
+            ctx.stroke();
+            ctx.closePath();
+        },
+        //获取图片
+        getImageInfo(imgSrc) {
+            return new Promise((resolve, reject) => {
+                uni.getImageInfo({
+                    src: imgSrc,
+                    success: (image) => {
+                        resolve(image);
+                        console.log('获取图片成功', image)
+                    },
+                    fail: (err) => {
+                        reject(err);
+                        console.log('获取图片失败', err)
+                    }
+                });
+            });
+        },
+        //保存图片到相册
+        saveImage() {
+            var that = this
+            //判断用户授权
+            uni.getSetting({
+                success(res) {
+                    console.log('获取用户权限', res.authSetting)
+                    let wpa = res.authSetting['scope.writePhotosAlbum']
+                    //判断是否有相册权限
+                    if (wpa == undefined) that.runSave()
+                    else if (!wpa) { //打开设置权限
+                        uni.openSetting({
+                            success(res) {
+                                console.log('设置权限', res.authSetting)
+                                if(res.authSetting['scope.writePhotosAlbum']) that.runSave()
+                            }
+                        })
+                    }
+                    else that.runSave()
+                }
+            })
+        },
+        runSave(){
+            var that = this
+            uni.canvasToTempFilePath({
+                canvasId: 'my-canvas',
+                quality: 1,
+                complete: (res) => {
+                    console.log('保存到相册', res);
+                    uni.saveImageToPhotosAlbum({
+                        filePath: res.tempFilePath,
+                        success(res) {
+                            uni.showToast({
+                                title: '已保存到相册',
+                                icon: 'success',
+                                duration: 2000
+                            })
+                            setTimeout(() => {
+                                that.isShow = false
+                            }, 2000)
+                        }
+                    })
+                }
+            }, this);
+        }
+    }
+}
+</script>
+<style scoped lang="scss">
+.content {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background: rgba(0, 0, 0, .4);
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+
+    .save-btn {
+        margin-top: 35rpx;
+        color: #FFFFFF;
+        background: linear-gradient(to right, #018C39, #00B147);
+        padding: 15rpx 40rpx;
+        border-radius: 50rpx;
+    }
+}
+</style>

+ 26 - 26
src/pagesC/components/nav/nav.vue

@@ -1,13 +1,13 @@
 <template>
-        <view class="search-customBar" :style="[{ height }]">
-            <view class="new-top" :style="{'top':marginTop}">
-                <image class="search-bak" src="@/static/img/search-bak-icon.png" mode="" @click="bakpage"></image>
-                <view class="new-search-box">
-                    <image src="@/static/img/new-search.png" mode=""></image>
-                    <input :focus="true" :placeholder="hint" v-model="goods" @confirm="search" />
-                </view>
+    <view class="search-customBar" :style="[{ height }]">
+        <view class="new-top" :style="{'top':marginTop}">
+            <image class="search-bak" src="@/static/img/search-bak-icon.png" mode="" @click="bakpage"></image>
+            <view class="new-search-box">
+                <image src="@/static/img/new-search.png" mode=""></image>
+                <input :focus="true" :placeholder="hint" v-model="goods" @confirm="search" />
             </view>
         </view>
+    </view>
 </template>
 <script>
 export default {
@@ -27,25 +27,25 @@ export default {
         },
     },
     created() {},
-	computed: {
-		height() {
-			const { platform, statusBarHeight } = uni.getSystemInfoSync()
-			let height = statusBarHeight + 4 //ios 24px
-			if (platform.toLowerCase() == "android") {
-				height += 4 //android 28px
-			}
-			// 胶囊高度 32px 下边框6px height 状态栏高度
-			return height + 38 + "px"
-		},
-		marginTop() {
-			const { platform, statusBarHeight } = uni.getSystemInfoSync()
-			let height = statusBarHeight + 4
-			if (platform.toLowerCase() == "android") {
-				height += 4
-			}
-			return height + "px"
-		}
-	},
+    computed: {
+        height() {
+            const { platform, statusBarHeight } = uni.getSystemInfoSync()
+            let height = statusBarHeight + 4 //ios 24px
+            if (platform.toLowerCase() == "android") {
+                height += 4 //android 28px
+            }
+            // 胶囊高度 32px 下边框6px height 状态栏高度
+            return height + 38 + "px"
+        },
+        marginTop() {
+            const { platform, statusBarHeight } = uni.getSystemInfoSync()
+            let height = statusBarHeight + 4
+            if (platform.toLowerCase() == "android") {
+                height += 4
+            }
+            return height + "px"
+        }
+    },
     methods: {
         bakpage() {
             uni.navigateBack({ delta: 1 })

+ 27 - 27
src/pagesC/settledMerchant/index.vue

@@ -1,26 +1,26 @@
 <template>
     <div class="settledMerchantList">
         <my-nav v-model="Query.name" @send="navSearch" />
-		<view class="next-search-history" v-if="oldKeywordList.length && !Query.name">
-			<view class="history-title">
-				<view class="title-name"><text>搜索历史</text></view>
-				<view class="history-delete" v-if="isDelete">
-					<view class="delete-all" @click="deleteAll"><text>全部删除</text></view>
-					<view class="delete-line"></view>
-					<view class="delete-complete" @click="deleteHistory"><text>完成</text></view>
-				</view>
-				<view v-else class="icon-block" @click="deleteHistory"><text class="iconfont" style="font-size: 36rpx;">&#xe601;</text></view>
-			</view>
-			<view class="next-history-list">
-				<view class="history-name" v-for="(item,index) in oldKeywordList" :key="index" @click="historyItemClick(item,index)">
+        <view class="next-search-history" v-if="oldKeywordList.length && !Query.name">
+            <view class="history-title">
+                <view class="title-name"><text>搜索历史</text></view>
+                <view class="history-delete" v-if="isDelete">
+                    <view class="delete-all" @click="deleteAll"><text>全部删除</text></view>
+                    <view class="delete-line"></view>
+                    <view class="delete-complete" @click="deleteHistory"><text>完成</text></view>
+                </view>
+                <view v-else class="icon-block" @click="deleteHistory"><text class="iconfont" style="font-size: 36rpx;">&#xe601;</text></view>
+            </view>
+            <view class="next-history-list">
+                <view class="history-name" v-for="(item,index) in oldKeywordList" :key="index" @click="historyItemClick(item,index)">
                     <text>{{item}}</text>
-					<text v-if="isDelete" class="iconfont">&#xe609;</text>
-				</view>
-			</view>
+                    <text v-if="isDelete" class="iconfont">&#xe609;</text>
+                </view>
+            </view>
             <view class="history-title">
                 <view class="title-name"><text>附近商家</text></view>
             </view>
-		</view>
+        </view>
         <div class="list" v-if="list.length">
             <div class="li_item" v-for="(i,s) in list" :key="s" @click="goMerchant(i)">
                 <!-- <div class="li_title">{{ i.name }}</div> -->
@@ -34,7 +34,7 @@
                 </div>
             </div>
         </div>
-        <empty v-else/>
+        <empty v-else />
     </div>
 </template>
 <script>
@@ -44,7 +44,7 @@ import empty from "@/pagesC/components/empty/empty"
 export default {
     name: "settledMerchantList",
     props: {},
-    components: { myNav,empty },
+    components: { myNav, empty },
     data() {
         return {
             list: [],
@@ -61,17 +61,16 @@ export default {
     },
     methods: {
         navSearch(va) {
-            if(va){
+            if (va) {
                 this.Query.name = va
                 if (!this.oldKeywordList.includes(va)) this.oldKeywordList.push(va);
                 this.setLS("oldKeywords", this.oldKeywordList)
-            }
-            else delete this.Query.name
+            } else delete this.Query.name
             this.getList(1);
         },
-        goMerchant(da){
-            this.setLS("merchant",da)
-            this.goto("/pagesC/settledMerchant/merchant",{id:da.id})
+        goMerchant(da) {
+            this.setLS("merchant", da)
+            this.goto("/pagesC/settledMerchant/merchant", { id: da.id })
         },
         // 获取当前位置
         async getLocation() {
@@ -114,7 +113,7 @@ export default {
     onLoad(da) {
         this.oldKeywordList = this.getLS("oldKeywords") || [];
         this.getLocation();
-        if(da.key) this.navSearch(decodeURIComponent(da.key))
+        if (da.key) this.navSearch(decodeURIComponent(da.key))
         else this.getList();
     },
     onShow() {},
@@ -179,7 +178,7 @@ export default {
         flex-wrap: wrap;
         padding: 12rpx 0;
 
-        .history-name {				
+        .history-name {
             background-color: #FFFFFF;
             border-radius: 25rpx;
             margin: 10rpx 12rpx;
@@ -197,7 +196,8 @@ export default {
             display: flex;
             align-items: center;
             justify-content: center;
-            .iconfont{
+
+            .iconfont {
                 margin-left: 8rpx;
             }
         }

+ 56 - 4
src/pagesC/settledMerchant/merchant.vue

@@ -30,16 +30,20 @@
         </div>
         <!-- 图片查看组件 -->
         <preview ref="previewimg" :listType="2" @close="previewclose"/>
+        <!-- 授权 -->
+        <authorize-module ref="autho" :shopInfo="shopInfo" @authGetTelSuccess="onauthGetTelSuccess" />
     </div>
 </template>
 <script>
+let app = getApp();
 import preview from "@/components/swiper-preview/index";
 import navcustom from "@/components/navigationCustom/navigation-custom.vue"
+import authorizeModule from "@/components/authorize-module/index";
 import { post } from "@/request/api.js";
 export default {
     name: "hotel",
     props: {},
-    components: { preview, navcustom },
+    components: { preview, navcustom, authorizeModule },
     data() {
         return {
             query: {},
@@ -58,7 +62,10 @@ export default {
                 menuIcon: "",
                 menuText: ""
             },
-            customShow: true
+            customShow: true,
+
+            shopInfo: {}, // 商铺信息
+            unid: "",
         };
     },
     methods: {
@@ -97,11 +104,56 @@ export default {
         topay(){
             this.setLS("topay_merchant",this.detail)
             this.goto("/pagesC/settledMerchant/pay")
-        }
+        },
+        SoHAuth() {
+            this.$refs.autho.onSoHAuth();
+        },
+        login(invite) {
+            let that = this;
+            // #ifdef  MP-WEIXIN
+            wx.login({
+                success(res) {
+                    if (res.code) {
+                        post("v1/appletLogin", {
+                            code: res.code,
+                            invite: uni.getStorageSync("inviteCode") || "XHCYGNZM"
+                        }).then((res) => {
+                            if (res.code === 0) {
+                                if (res.data.token) {
+                                    uni.setStorageSync("token", res.data.token);
+                                    that.merchant();
+                                } else {
+                                    that.unid = res.data.unid;
+                                    that.shopInfo = app.globalData.shopInfo;
+                                    that.SoHAuth(); //调取授权弹窗
+                                }
+                            }
+                        });
+                    }
+                },
+            });
+            // #endif
+        },
+        onauthGetTelSuccess(da) {
+            this.SoHAuth();
+            post("v1/getMobile", {
+                unid: this.unid,
+                ...da.detail,
+            }).then((res) => {
+                if (res.code === 0) {
+                    uni.setStorageSync("token", res.data.token);
+                    this.merchant();
+                }
+            });
+        },
     },
     onLoad(da) {
         this.merchantID = da.id;
-        this.merchant();
+        let token = uni.getStorageSync("token");
+        if (!token) this.login();
+        else {
+            this.merchant();
+        }
     },
     onShow() {
         this.merchantInfo = this.getLS("merchant")

+ 37 - 15
src/pagesC/settledMerchant/myShop.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="myshop">
         <div class="card">
-            <div class="money">¥{{money.withdraw_money}}</div>
+            <div class="money">¥{{money.withdraw_money || "0.00"}}</div>
             <div class="msg">可提现金额(元)</div>
             <div class="btn">
                 <span>去提现</span>
@@ -9,12 +9,12 @@
             </div>
         </div>
         <div class="elseMoney flex_r flex_jb flex_ac">
-            <div class="total_money">总收入<span>¥{{money.total_money}}</span></div>
-            <div class="day_income">今日收入<span>¥{{money.day_income}}</span></div>
+            <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>
         <div class="list" v-if="list.length">
             <div class="list-item" v-for="(i,s) in list" :key="s">
-                <div class="head_info_row flex_r flex_ac">
+                <div class="head_info_row flex_r flex_ac flex_jb">
                     <image class="logo" :src="i.logo" />
                     <div class="head_name">
                         <div class="name">{{ i.name }}</div>
@@ -23,6 +23,7 @@
                             <span class="commentScore">{{i.score}}分</span>
                         </div>
                     </div>
+                    <div class="twocode iconfont" @click="showcode({id:i.merchant_id,name:i.name})">&#xe635;</div>
                 </div>
                 <div class="p1 flex_r">
                     <div class="l"><span class="iconfont">&#xe9d2;</span>业务员:{{i.nickname}}</div>
@@ -34,16 +35,18 @@
                 </div>
             </div>
         </div>
-        <empty v-else/>
+        <empty v-else />
+        <create-code ref="createCode" />
     </div>
 </template>
 <script>
 import empty from "@/pagesC/components/empty/empty"
+import createCode from "@/pagesC/components/createCode/index"
 import { post } from "@/request/api.js";
 export default {
     name: "myshop",
     props: {},
-    components: {empty},
+    components: { empty, createCode },
     data() {
         return {
             list: [],
@@ -52,7 +55,7 @@ export default {
     },
     methods: {
         getList(page) {
-            uni.showLoading({title: '加载中'})
+            uni.showLoading({ title: '加载中' })
             post("v1/merchant/myShop").then(res => {
                 if (res.code == 0) {
                     this.list = res.data.list.data
@@ -62,6 +65,9 @@ export default {
                 }
             })
         },
+        showcode(da) {
+            this.$refs.createCode.showCanvas(da)
+        }
     },
     onLoad(da) {
         this.getList()
@@ -142,11 +148,18 @@ export default {
         margin-left: 8rpx;
     }
 }
-.list{
+
+.list {
     padding: 60rpx 0 30rpx;
-    .list-item{
+
+    .list-item {
         margin-bottom: 50rpx;
+        border-radius: 16rpx;
+        padding: 28rpx 32rpx;
+        border: 2rpx solid rgba(0, 0, 0, 0.12);
+        box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
     }
+
     .head_info_row {
         .logo {
             width: 120rpx;
@@ -155,27 +168,36 @@ export default {
             margin-right: 25rpx;
             border: 1px solid #e5e5e5;
         }
-    
+
         .head_name {
+            width: calc(100% - 220rpx);
+
             .name {
                 font-size: 36rpx;
                 font-weight: 600;
                 margin-bottom: 12rpx;
             }
-    
+
             .commentScore {
                 margin-left: 10rpx;
                 font-size: 24rpx;
             }
         }
+
+        .twocode {
+            font-size: 60rpx;
+        }
     }
-    .p1{
+
+    .p1 {
         font-size: 26rpx;
-        margin-top: 12rpx;
-        div{
+        margin-top: 20rpx;
+
+        div {
             width: 50%;
         }
-        .iconfont{
+
+        .iconfont {
             font-size: 26rpx;
             color: #2E57FD;
             margin-right: 10rpx;

+ 0 - 0
src/pages/orderingfood/tabs.js → src/static/js/tabs.js