Răsfoiți Sursa

分享 与 邀请

shish 5 ani în urmă
părinte
comite
fe756a660c

+ 1 - 0
ghsApp/src/admin/home/workbench.vue

@@ -353,6 +353,7 @@ export default {
 			});
 		},
 		getMyMall(){
+			console.log('pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId)
 			getWeixinId().then(res => {
 				uni.navigateToMiniProgram({
 					//姜枫-2021.04.13

+ 1 - 3
hdApp/src/admin/billing/index.vue

@@ -140,7 +140,6 @@
 		</modal-module>
 		<FooterCart :price="allGoodsPrice" :count="allGoodsCount" @confirm="confirmSelectGoodsEvent" v-if="tabIndex == 0"></FooterCart>
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" v-if="tabIndex == 1"></FooterCart>
-    <noneHd></noneHd>
 	</view>
 </template>
 
@@ -153,7 +152,6 @@ import GoodsCommondity from "@/components/module/app-goods-commodity";
 import PxClassCommondity from "@/components/module/app-pxClass-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
-import noneHd from "@/components/none-hd"
 import allMoreSelectInput from "@/components/module/allMoreSelectInput";
 import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
 
@@ -167,7 +165,7 @@ export default {
 		AppWrapperEmpty,
 		Commondity,
 		ModalModule,
-		FooterCart,allMoreSelectInput,PxClassCommondity,GoodsCommondity,noneHd
+		FooterCart,allMoreSelectInput,PxClassCommondity,GoodsCommondity
 	},
 	mixins: [productMins,allMoreSelectInputMins],
 	data() {

+ 40 - 17
hdApp/src/components/none-hd.vue

@@ -1,58 +1,81 @@
 <template>
   <view class="model" v-if="show">
-    <image :src="`${constant.imgUrl}/ghs/home/deserve.png`" class="noData_img"></image>
-    <view class="no_data_text">您还没有花店,无法采购哦~</view>
-    <view class="freeApply" @click=" pageTo({url: '/pagesClient/official/index'})">免费申请</view>
+    <image
+      :src="`${constant.imgUrl}/ghs/home/deserve.png`"
+      class="noData_img"
+    ></image>
+    <view class="no_data_text">您还没有花店,无法采购哦~</view>
+    <view class="freeApply" @click="apply">免费申请</view>
   </view>
 </template>
 
 <script>
 export default {
   props: {
-    show:{
-      type:Boolean,
-      default: true
+    show: {
+      type: Boolean,
+      default: true,
+    },
+    hdShopAdminId: {
+      type: Number,
+      default: 0,
+    },
+    ghsShopAdminId: {
+      type: Number,
+      default: 0,
     },
   },
   data() {
     return {
       constant: this.$constant,
-    }
-  }
-}
+    };
+  },
+  methods: {
+    apply() {
+      this.$util.pageTo({
+        url: "/pagesClient/official/index",
+        type: 2,
+        query: {
+          ghsShopAdminId: this.ghsShopAdminId,
+          hdShopAdminId: this.hdShopAdminId
+        },
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-.model{
+.model {
   position: fixed;
   z-index: 9999;
   top: 0;
   left: 0;
   width: 100vw;
   height: 100vh;
-  background: rgba(0,0,0, 0.6);
+  background: rgba(0, 0, 0, 0.6);
   color: #fff;
   text-align: center;
-  &>.noData_img{
+  & > .noData_img {
     width: 318upx;
     height: 318upx;
     margin: 332upx auto 0;
   }
-  &>.no_data_text{
+  & > .no_data_text {
     font-size: 32px;
-    color: #FFFFFF;
+    color: #ffffff;
     text-align: center;
     margin: 50upx 0;
   }
-  &>.freeApply{
+  & > .freeApply {
     width: 376px;
     height: 88px;
     line-height: 88upx;
-    background: linear-gradient(90deg, #3385FF, #33B0FF);
+    background: linear-gradient(90deg, #3385ff, #33b0ff);
     border-radius: 44px;
     margin: 0 auto;
     font-size: 32px;
-    color: #FFFFFF;
+    color: #ffffff;
     text-align: center;
   }
 }

+ 70 - 143
hdApp/src/pagesClient/official/apply.vue

@@ -2,10 +2,7 @@
   <div class="app-content">
     <form @submit="formSubmit">
       <div class="module-com">
-        <tui-list-cell
-          class="line-cell"
-          :hover="false"
-        >
+        <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">花店名称</div>
           <input
             v-model="form.name"
@@ -23,14 +20,10 @@
           @click="openAddres"
         >
           <div class="tui-title">所在城市</div>
-          <div
-            class="tui-input"
-            v-if="form.province"
-          >{{ form.province + '-' + form.city }}</div>
-          <div
-            class="tui-placeholder"
-            v-else
-          >请选择</div>
+          <div class="tui-input" v-if="form.province">
+            {{ form.province + "-" + form.city }}
+          </div>
+          <div class="tui-placeholder" v-else>请选择</div>
         </tui-list-cell>
         <tui-list-cell
           class="line-cell"
@@ -39,19 +32,10 @@
           @click="selRegionFn"
         >
           <div class="tui-title">详细地址</div>
-          <div
-            class="tui-input"
-            v-if="form.address"
-          >{{ form.address }}</div>
-          <div
-            class="tui-placeholder"
-            v-else
-          >请填写详细地址</div>
+          <div class="tui-input" v-if="form.address">{{ form.address }}</div>
+          <div class="tui-placeholder" v-else>请填写详细地址</div>
         </tui-list-cell>
-        <tui-list-cell
-          class="line-cell"
-          :hover="false"
-        >
+        <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">门牌号</div>
           <input
             v-model="form.floor"
@@ -62,24 +46,14 @@
             placeholder="楼号门牌号(选填)"
           />
         </tui-list-cell>
-        <tui-list-cell
-          class="line-cell"
-          :hover="false"
-        >
+        <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">花店头像</div>
-          <app-uploader
-            @resultData="_resultData"
-            :num="1"
-          />
+          <app-uploader @resultData="_resultData" :num="1" />
         </tui-list-cell>
       </div>
       <!-- 店长昵称 -->
       <div class="module-com">
-        <AppBindInfo
-          @bindInfo="bindInfo"
-          nameTetx="我的昵称"
-        >
-        </AppBindInfo>
+        <AppBindInfo @bindInfo="bindInfo" nameTetx="我的昵称"> </AppBindInfo>
       </div>
       <!-- 手机号 -->
       <div class="module-com">
@@ -92,23 +66,28 @@
           <div>
             <button
               @click="changeMain(1)"
-              :class="['admin-button-com','mini-btn',form.main==1?'blue':'default']"
+              :class="[
+                'admin-button-com',
+                'mini-btn',
+                form.main == 1 ? 'blue' : 'default',
+              ]"
             >
               零售
             </button>
             <button
               @click="changeMain(2)"
-              style="margin-left:10px;"
-              :class="['admin-button-com','mini-btn',form.main==2?'blue':'default']"
+              style="margin-left: 10px"
+              :class="[
+                'admin-button-com',
+                'mini-btn',
+                form.main == 2 ? 'blue' : 'default',
+              ]"
             >
               培训
             </button>
           </div>
         </tui-list-cell>
-        <tui-list-cell
-          class="line-cell"
-          :hover="false"
-        >
+        <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">营业执照编号</div>
           <input
             v-model="form.licenseNo"
@@ -119,18 +98,10 @@
             placeholder="请输入营业执照编号"
           />
         </tui-list-cell>
-        <tui-list-cell
-          class="line-cell"
-          :hover="false"
-        >
+        <tui-list-cell class="line-cell" :hover="false">
           <div class="tui-title">营业执照</div>
-          <app-uploader
-            @resultData="resultData"
-            ref="appUploader"
-            :num="1"
-          />
+          <app-uploader @resultData="resultData" ref="appUploader" :num="1" />
         </tui-list-cell>
-
       </div>
       <!-- 推荐人 -->
       <div
@@ -140,9 +111,9 @@
         <div class="recommend-tag">推荐人</div>
         <div class="recommend-det">
           <image
-            style="width:90rpx;height:90rpx;border-radius:42rpx;"
+            style="width: 90rpx; height: 90rpx; border-radius: 42rpx"
             mode="scaleToFill"
-            :src="merchantData.smallLogoUrl"
+            :src="merchantData.logoUrl"
             @error="imageError"
           />
           <div class="recommend-info">
@@ -153,10 +124,9 @@
       </div>
 
       <div class="btn-wrap">
-        <button
-          class="admin-button-com blue big"
-          formType="submit"
-        >确认</button>
+        <button class="admin-button-com blue big" formType="submit">
+          确认
+        </button>
       </div>
       <!-- 选择地区 -->
       <app-area-sel
@@ -179,18 +149,10 @@ import TuiListCell from "@/components/plugin/list-cell";
 import AppAreaSel from "@/components/app-area-sel";
 import SimpleAddress from "@/components/plugin/simple-address";
 import AppAvatarModule from "@/components/module/app-avatar";
-// import { getWxInfo, getWxPhone } from "@/api/mini";
 import AppUploader from "@/components/app-uploader";
 import AppBindInfo from "@/components/app-bind-info";
 const form = require("@/utils/formValidation.js");
-// api
-import {
-  getIntroduce,
-  applyRegister,
-  // sendSmsW,
-  // regionTree
-} from "@/api/official";
-// import { getShopUser } from '@/utils/auth'
+import { getIntroduce, applyRegister } from "@/api/official";
 export default {
   name: "apply-data",
   components: {
@@ -199,9 +161,9 @@ export default {
     SimpleAddress,
     AppAvatarModule,
     AppUploader,
-    AppBindInfo
+    AppBindInfo,
   },
-  data () {
+  data() {
     return {
       merchantData: {},
       form: {
@@ -211,14 +173,14 @@ export default {
         city: "",
         dist: "",
         address: "",
-        adminName: '',
+        adminName: "",
         main: 1,
         licenseNo: "",
         license: "",
         // floor: "",
         longitude: "",
         latitude: "",
-        logo: ''
+        logo: "",
       },
       showRegion: false,
       // 省市联动
@@ -228,121 +190,91 @@ export default {
       isSend: 0,
       countDown: 119,
       timer: null,
-      adminName: ""
+      adminName: "",
     };
   },
-  onLoad () {
-  },
+  onLoad() {},
   methods: {
     //图片地址
-    resultData (val) {
-      this.form.license = val.shortUrl
+    resultData(val) {
+      this.form.license = val.shortUrl;
     },
-    _resultData (val) {
-      console.log(val)
-      this.form.logo = val.shortUrl
+    _resultData(val) {
+      console.log(val);
+      this.form.logo = val.shortUrl;
     },
-    changeMain (val) {
-      this.form.main = val
+    changeMain(val) {
+      this.form.main = val;
     },
-    bindInfo (val) {
+    bindInfo(val) {
       this.form.adminName = val.name;
-      this.form.mobile = val.mobile
+      this.form.mobile = val.mobile;
     },
-    init () {
-      this.$util.getCheckLogin().then(res => {
-        if (res) {
-          if (this.option.introMerchantId) {
-            this._getMerchantDet();
-          }
-        }
-      });
+    init() {
+      this.getIntroduceInfo();
     },
-    _getMerchantDet () {
-      getIntroduce({ id: this.option.introMerchantId || 0 }).then(res => {
-        this.merchantData = res.data;
-      });
+    getIntroduceInfo() {
+      getIntroduce(this.option).then((res) => {
+        this.merchantData = res.data.introduce
+      })
     },
-    // ==============
-    confirmFn () {
+    confirmFn() {
       applyRegister({
-        shopAdminId: this.option.shopAdminId,
+        hdShopAdminId: this.option.hdShopAdminId,
+        ghsShopAdminId: this.option.ghsShopAdminId,
         ...this.form,
         style: this.option.style || 0,
-        from: this.option.from || 0
-      }).then(res => {
+        from: this.option.from || 0,
+      }).then((res) => {
         this.$util.pageTo({
           url: "/pagesClient/official/result",
           type: 2,
           query: {
-            pagestatus: 3
-          }
+            pagestatus: 3,
+          },
         });
       });
     },
     // 选择地址
-    selRegionFn () {
+    selRegionFn() {
       if (!this.form.city) {
         this.$msg("请先选择城市!");
         return false;
       }
       this.showRegion = true;
-      // let that = this
-      // uni.chooseLocation({
-      // 	success: (res) => {
-      // 		this.form.address = res.address
-      // 		this.form.latitude = res.latitude
-      // 		this.form.longitude = res.longitude
-      // 		console.log('位置名称:' + res.name)
-      // 		console.log('详细地址:' + res.address)
-      // 		console.log('纬度:' + res.latitude)
-      // 		console.log('经度:' + res.longitude)
-      // 	}
-      // })
     },
-    changeAreaFn (e) {
-      console.log("changeAreaFn", e);
+    changeAreaFn(e) {
       this.form.address = e.address;
       this.form.latitude = e.location.lat;
       this.form.longitude = e.location.lng;
-      this.form.dist = e.district
+      this.form.dist = e.district;
     },
-    // -----
     // 省市联动
-    openAddres () {
+    openAddres() {
       this.$refs.simpleAddress.open();
     },
-    onCityConfirm (e) {
-      // this.form.receiveAddress = e.label
+    onCityConfirm(e) {
       this.form.province = e.provinceName;
       this.form.city = e.cityName;
-      // this.pickerText = JSON.stringify(e)
     },
     // 表单验证
-    formSubmit (e) {
+    formSubmit(e) {
       // 表单规则
       let rules = [
         {
           name: "name",
           rule: ["required"],
-          msg: ["请填写昵称"]
+          msg: ["请填写昵称"],
         },
         {
           name: "licenseNo",
           rule: ["required"],
-          msg: ["请输入营业执照编号"]
-        }
+          msg: ["请输入营业执照编号"],
+        },
       ];
       // 进行表单检查
       let formData = this.form;
       let checkRes = form.validation(formData, rules);
-      // this.$util.pageTo({
-      //     url: "/pagesClient/official/callback",
-      //     type: 2,
-      //     query: {
-      //       pagestatus: 1
-      //     }
-      //   });
       // 验证通过!
       if (!checkRes) {
         setTimeout(() => {
@@ -351,14 +283,9 @@ export default {
       } else {
         this.$msg(checkRes);
       }
-    }
+    },
   },
-  watch: {
-    // imageList(val){
-    //   this.form.
-    //   console.log(val)
-    // }
-  }
+  watch: {},
 };
 </script>
 

+ 2 - 37
hdApp/src/pagesClient/official/index.vue

@@ -21,8 +21,7 @@
     <!-- ad -->
     <div class="cooperation-wrap" :style="{backgroundImage:'url(' + backgroundImg + ')'}">
       <div class="ad-title">
-        <span>他们</span>
-        <span class="app-color-1">都在用</span>
+        <span>他们都在用</span>
       </div>
       <div class="ad-list-wrap">
         <div class="ad-list" v-for="(item, index) in adData" :key="index">
@@ -50,20 +49,7 @@
       <img :src="`${constant.imgUrl}/retail/common/trademark.png`" alt />
     </div>
     <!-- buttom -->
-    <div
-      v-if="status == 3"
-      class="app-footer"
-      @click="pageTo({
-			url: '/pagesClient/official/pay',
-			status: 1
-		})"
-    >立即续费</div>
-    <div v-else class="app-footer" @click="pageTo({
-			url: '/pagesClient/official/pay',
-      query:{
-        ...option
-      }
-		})">申请试用</div>
+    <div class="app-footer" @click="pageTo({url: '/pagesClient/official/pay',query:{...option}})">申请试用</div>
   </div>
 </template>
 
@@ -82,7 +68,6 @@ export default {
   data() {
     return {
       constant: this.$constant,
-      status: -2,
       swiper: [
         {
           img: `${this.$constant.imgUrl}/retail/official/banner-1.png`
@@ -150,26 +135,6 @@ export default {
     uni.hideHomeButton()
   },
   methods: {
-    init() {
-      // 续费
-      if (this.option.pay == 1) {
-        this.status = 3;
-        uni.setStorageSync("renewOption", JSON.stringify(this.option));
-      } else {
-        uni.removeStorageSync("renewOption");
-      }
-      //花店分享的页面有邀人,打开页面保存邀请人
-      // let introMerchantId = 0;
-      // if (typeof this.option.introMerchantId != "undefined") {
-      //   introMerchantId = this.option.introMerchantId;
-      // }
-      // uni.setStorageSync("introMerchantId", introMerchantId);
-    },
-    _getDet() {
-      applyStatus().then(res => {
-        this.status = res.data.status;
-      });
-    },
     contactFn() {
       uni.makePhoneCall({
         phoneNumber: "05923272000"

+ 4 - 37
hdApp/src/pagesClient/official/pay.vue

@@ -27,39 +27,17 @@
     </div>
     <!-- buttom -->
     <div class="page-btn app-footer">
-      <div v-if="$util.isEmpty(renewOption)" class="flex-center">
+      <div class="flex-center">
         <span></span>
         <span class="app-price">
           <span></span>
           <span class="app-size-40" style="text-decoration:line-through">{{ detail.price }}</span>
         </span>
       </div>
-
-      <div v-else class="flex-center">
-        <span>合计</span>
-        <span class="app-price">
-          <span>¥</span>
-          <span class="app-size-40">{{ detail.price }}</span>
-        </span>
-      </div>
-
-      <button
-        v-if="$util.isEmpty(renewOption)"
-        class="admin-button-com middle blue"
-        @click="pageTo({
-			    url: '/pagesClient/official/apply',type:2,
-          query:{
-            ...option
-          }
-		})"
-      >免费试用</button>
-      <button v-else class="admin-button-com middle blue" @click="wxPay">
-        支付
-      </button>
+      <button class="admin-button-com middle blue" @click="pageTo({url: '/pagesClient/official/apply',type:2,query:{...option}})">免费试用</button>
     </div>
   </div>
 </template>
-
 <script>
 import wexinPay from "@/utils/pay/wxPay";
 import { getMealDet, renewWxPay } from "@/api/official";
@@ -69,17 +47,12 @@ export default {
     return {
       constant: this.$constant,
       detail: {},
-      funcitonData: [],
-      renewOption: null
+      funcitonData: []
     };
   },
   methods: {
     init() {
-      this._getMealDet();
-      let renewOption = uni.getStorageSync("renewOption");
-      if (renewOption) {
-        this.renewOption = JSON.parse(renewOption);
-      }
+      this._getMealDet()
     },
     _getMealDet() {
       getMealDet({ id: 1 }).then(res => {
@@ -91,12 +64,6 @@ export default {
       });
     },
     wxPay() {
-      renewWxPay({
-        id: this.detail.id,
-        merchantId: this.renewOption.merchantId
-      }).then(res => {
-        wexinPay(res.data, this.paySuccess, this.payFail);
-      });
     },
     // 支付成功
     paySuccess() {

+ 2 - 2
hdApp/src/pagesInvite/list.vue

@@ -127,14 +127,14 @@ export default {
 				title: "更懂您的花卉宝",
 				desc: "",
 				imgUrl: this.constant.imgUrl + "/retail/official/banner-1.png",
-				path: `/pagesClient/official/index?introMerchantId=${this.userInfo.id}&form=2&style=2&shopAdminId=${this.getLoginInfo.shopAdminId}`
+				path: `pagesClient/official/index?introMerchantId=${this.userInfo.id}&form=2&style=2&shopAdminId=${this.getLoginInfo.shopAdminId}`
 			};
 		} else if (res.target.id === "sharekh") {
 			return {
 				title: "更懂您的花卉宝",
 				desc: "",
 				imgUrl: this.constant.imgUrl + "/retail/official/banner-1.png",
-				path: `/pagesClient/official/apply?introMerchantId=${this.userInfo.id}&form=2&style=1`
+				path: `pagesClient/official/apply?introMerchantId=${this.userInfo.id}&form=2&style=1`
 			};
 		} else {
 			return {};

+ 29 - 7
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -95,6 +95,7 @@
 		>
 		</modal-module>
 		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmSelectEvent" ></FooterCart>
+		<noneHd :show.sync="notOpenShop" :ghsShopAdminId.sync="ghsShopAdminId" :hdShopAdminId.sync="hdShopAdminId"></noneHd>
 	</view>
 </template>
 
@@ -107,10 +108,10 @@ import GoodsCommondity from "@/components/module/app-goods-commodity";
 import PxClassCommondity from "@/components/module/app-pxClass-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
-
+import noneHd from "@/components/none-hd";
 import allMoreSelectInput from "@/components/module/allMoreSelectInput";
 import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
-
+import {mapActions, mapGetters} from "vuex";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
 // import suitProductMins from "@/mixins/ghsProduct";
@@ -122,7 +123,13 @@ export default {
 		AppWrapperEmpty,
 		Commondity,
 		ModalModule,
-		FooterCart,allMoreSelectInput,PxClassCommondity,GoodsCommondity
+		FooterCart,allMoreSelectInput,PxClassCommondity,GoodsCommondity,noneHd
+	},
+	props: {
+		ghsShopAdminId:{
+			type:Number,
+			default: 0
+		},
 	},
 	mixins: [productMins,allMoreSelectInputMins],
 	data() {
@@ -134,7 +141,9 @@ export default {
 				bigCount: 0,
 				smallCount: 0
 			},
-			showSubmitModel: false
+			showSubmitModel: false,
+			notOpenShop:false,
+			hdShopAdminId:0
 		};
 	},
 	computed: {
@@ -144,13 +153,26 @@ export default {
 				content = "有花材库存不足,确认下一步?";
 			}
 			return content;
+		},
+		//判断是否已经开店 shish 2021.4.22
+		ifOpenShop(){
+			if(this.loginInfo.shopAdminId == 0){
+				this.notOpenShop = true
+			}else{
+				this.hdShopAdminId = this.loginInfo.shopAdminId
+			}
 		}
 	},
-
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
+		this.resetSelectInfoByType(this.pageType)
+	},
+	onShareAppMessage(res) {
+		return {
+			title: "xxxxx",
+			desc: "",
+			path: `pagesPurchase/gshProudct?hdShopAdminId=${this.loginInfo.shopAdminId}&ghsShopAdminId=${this.options.ghsShopAdminId}&shopId=${this.options.shopId}`
+		}
 	},
-
 	methods: {
 		//自定义数量
 		customNum(info) {