stanley-king vor 4 Jahren
Ursprung
Commit
ca0d9e8fd1

+ 5 - 3
app.js

@@ -70,7 +70,8 @@ App({
         mWxAuthor:null,
         member_id:0,
         hasmobile: false,
-        relay_id:0
+        relay_id:0,
+        channel_num:0
     },
 
     setFromSource(fromSource) {
@@ -152,9 +153,10 @@ App({
         let imageUrl = '/image/xyzshare.png'
         let share_path = `/pages/index/index?relay_id=${userid}`
         console.log('share path:', share_path)
-        
+
+        let title = '我正在充值,麻烦帮我授权一下,100元能省5元哦!拜托拜托~'        
         return {
-            title: '移动、联通、电信、中石油、中石化,首充95折,即刻到账',
+            title: title,
             path: share_path,
             imageUrl: imageUrl,
         }

+ 2 - 2
config.js

@@ -1,7 +1,7 @@
 // let api = "https://passport.lrlz.com/mobile/index.php";
 // let api = "http://www.xyzshops.cn/mobile/index.php";
-let api = "http://192.168.1.200/mobile/index.php";
-// let api = "https://www.xyzshops.cn/mobile/index.php";
+// let api = "http://192.168.1.200/mobile/index.php";
+let api = "https://www.xyzshops.cn/mobile/index.php";
 // let api = "http://www.xyzshops.cn/mobile/index.php";
 
 

BIN
image/myhome/rcode.png


+ 2 - 1
pages/components/auth/auth.js

@@ -72,7 +72,8 @@ Component({
         phone_info: phoneInfo,
         act: "login",
         op: "wxauthen",
-        relay_id: app.globalData.relay_id
+        relay_id: app.globalData.relay_id,
+        channel: app.globalData.channel
       }
 
       let self = this;

+ 4 - 4
pages/components/shareDialog/shareDialog.js

@@ -79,10 +79,10 @@ Component({
         success(res) {
           var itemSettings = res.subscriptionsSetting.itemSettings
           console.log('setting:', itemSettings)
-          if (itemSettings) {
-            if (itemSettings['模版id'] === 'accept') {
-            }
-          }
+          // if (itemSettings) {
+          //   if (itemSettings['模版id'] === 'accept') {
+          //   }
+          // }
         }
       })
     },

+ 31 - 0
pages/components/showImage/showImage.js

@@ -0,0 +1,31 @@
+// pages/components/showImage/showImage.js
+
+let app = getApp();
+Component({
+	/**
+	 * 组件的属性列表
+	 */
+	properties: {
+		imageUrl: {
+			type:String,
+			value:''
+		}
+	},
+
+	/**
+	 * 组件的初始数据
+	 */
+	data: {
+
+	},
+
+	/**
+	 * 组件的方法列表
+	 */
+	methods: {
+		closeMiniDialog() {
+			console.log('closeMiniDialog')
+			this.triggerEvent('closeDialog',{})
+		}
+	}
+})

+ 4 - 0
pages/components/showImage/showImage.json

@@ -0,0 +1,4 @@
+{
+	"component": true,
+	"usingComponents": {}
+}

+ 10 - 0
pages/components/showImage/showImage.wxml

@@ -0,0 +1,10 @@
+<!--pages/components/showImage/showImage.wxml-->
+<view  class="sharePopup"  bindtap="closeMiniDialog">
+	<view class="shareDialog">
+    <!-- <image src="../../../image/close_icon.png" class="close_icon" ></image> -->
+    <view>
+        <image src="{{imageUrl}}" mode="heightFix"></image>
+    </view>
+    </view>
+</view>
+

+ 28 - 0
pages/components/showImage/showImage.wxss

@@ -0,0 +1,28 @@
+/* pages/components/showImage/showImage.wxss */
+.sharePopup {
+  position: fixed;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  top: 0;
+  background: rgba(0, 0, 0, 0.7);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  z-index: 100;
+}
+.shareDialog {
+  position: relative;
+  width: 600rpx;
+  height: 600rpx;
+  display: flex;
+  justify-content: center;
+  padding-top: 0rpx;
+}
+.close_icon {
+  position: absolute;
+  right: -25rpx;
+  top: -25rpx;
+  width: 100rpx;
+  height: 100rpx;
+}

+ 4 - 0
pages/index/index.js

@@ -46,6 +46,10 @@ Page({
       app.globalData.relay_id = options.relay_id
       console.log('options.relay_id:', options.relay_id)
     }
+    if (options && options.channel) {
+      app.globalData.channel_num = options.channel
+      console.log('options.channel:', options.channel)
+    }
     this.getDatas()
   },
   freeBonus() {

+ 2 - 1
pages/login/login.js

@@ -79,7 +79,8 @@ Page({
           user_info: userInfo,
           act: "login",
           op: "wxauthen",
-          relay_id: app.globalData.relay_id
+          relay_id: app.globalData.relay_id,
+          channel: app.globalData.channel_num
       }
       getReq(app,params, function (res) {
         if (res.code == 200) {

+ 13 - 3
pages/myhome/myhome.js

@@ -13,13 +13,15 @@ Page({
     sinopec:{},
     petrochina:{},
     phone: {},
+    mini_code:'',
     
     pre_pay_count: 0, // 待付款 10
     pre_send_count: 0, // 待发货 20
     pre_receive_count: 0, // 待收货 30
     evaluate_count: 0, // 已收货 40
 
-    userInfo: app.globalData.userInfo
+    userInfo: app.globalData.userInfo,
+    showRCode: false
   },
 
   handleMore(e) {
@@ -72,11 +74,11 @@ Page({
       if (res.code == 200) {
         console.log(res.datas)
         if(res.datas) {
-          const { cards, sub_titles } = res.datas
+          const { cards, sub_titles, mini_code } = res.datas
           const phone = app.getValueByKey('phone', cards)
           const petrochina = app.getValueByKey('petrochina', cards)
           const sinopec = app.getValueByKey('sinopec', cards)
-          this.setData({ memberInfo: {...res.datas}, phone, petrochina, sinopec })
+          this.setData({ memberInfo: { ...res.datas }, phone, petrochina, sinopec, mini_code })
         }
       } else {
           app.showToast(res.message)
@@ -132,6 +134,14 @@ Page({
       });
     }
   },
+  onShowMiniCode(e) {
+    console.log('onShowMiniCode',this.mini_code)
+    this.setData({ showRCode:true })
+  },
+  onCloseMiniDialog() {
+    console.log('myhome,onCloseMiniDialog')
+    this.setData({ showRCode: false })
+  },
 
   /**
    * 生命周期函数--监听页面隐藏

+ 2 - 1
pages/myhome/myhome.json

@@ -3,6 +3,7 @@
   "navigationBarBackgroundColor": "#ffffff",
   "navigationBarTextStyle": "black",
   "usingComponents": {
-    "auth": "../components/auth/auth"
+    "auth": "../components/auth/auth",
+    "showImage":"../components/showImage/showImage"
   }
 }

+ 5 - 5
pages/myhome/myhome.wxml

@@ -4,13 +4,12 @@
 	<view class="topbg"></view>
 	<view class="header">
 		<image src="{{memberInfo.member_avatar}}" class="avtor"></image>
-		<view class="info">
+		<view class="info" >
 			<view class="leftContent">
 				<text class="nickname">{{memberInfo.member_nickname}}</text>
-				<text class="qrcodeLabel">点击分享二维码</text>
+				<text class="qrcodeLabel">点击二维码面对面邀请</text>
 			</view>
-			<image src="/image/myhome/arrow-right.png" class="link"></image>
-			<!-- <text class="other" wx:if="{{memberInfo.is_vip}}">会员额度还剩下:{{memberInfo.vip_left_amount}}元</text> -->
+			<image src="/image/myhome/rcode.png" class="link" bindtap="onShowMiniCode"></image>
 		</view>
 	</view>
 
@@ -97,5 +96,6 @@
 			</view>
 		</view>
 	</view>
+</view>
 
-</view>
+<showImage wx:if="{{showRCode}}" imageUrl="{{mini_code}}"  bind:closeDialog="onCloseMiniDialog" />

+ 3 - 1
utils/WxAuthor.js

@@ -76,11 +76,13 @@ export default class WxAuthor {
   }
   wxauthen(userInfo) {
     let relay_id = this.target.globalData.relay_id
+    let channel_num = this.target.globalData.channel_num
     let params = {
       user_info: userInfo,
       act: "login",
       op: "wxauthen",
-      relay_id: relay_id
+      relay_id: relay_id,
+      channel: channel_num
     }
     getReq(this.target,params, res => {
       if (res.code == 200) {