Browse Source

消息通知设置

xiaohaizhao 1 year ago
parent
commit
47290b8304

+ 3 - 1
app.json

@@ -13,7 +13,9 @@
     "pages/teams/addUsers",
     "pages/teams/addRole",
     "pages/tabbar/mine/address/index",
-    "pages/tabbar/mine/address/update"
+    "pages/tabbar/mine/address/update",
+    "pages/tabbar/mine/webView",
+    "pages/tabbar/mine/associatedPublicNumber"
   ],
   "subpackages": [
     {

+ 37 - 0
pages/tabbar/mine/associatedPublicNumber.js

@@ -0,0 +1,37 @@
+const _Http = getApp().globalData.http;
+
+Page({
+  data: {
+    text: "",
+    code: ""
+  },
+  onLoad(options) {
+    console.log(options)
+    if (options.code == 0) {
+      this.setData({
+        text: "绑定出错 请稍后再试"
+      })
+    } else {
+      this.WechatServceBinding(options.code);
+    }
+  },
+  WechatServceBinding(wechat_code) {
+    _Http.basic({
+      "classname": "common.usercenter.usercenter",
+      "method": "WechatServceBinding",
+      "content": {
+        "accesstoken": wx.getStorageSync('userMsg').token,
+        "systemclient": "wservice",
+        wechat_code
+      }
+    }).then(res => {
+      console.log("绑定公众号", res)
+      this.setData({
+        code: res.msg == '成功' ? "" : wechat_code
+      })
+    })
+  },
+  onShow() {
+    this.data.code && this.WechatServceBinding(this.data.code);
+  }
+})

+ 4 - 0
pages/tabbar/mine/associatedPublicNumber.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "关联公众号"
+}

+ 16 - 0
pages/tabbar/mine/associatedPublicNumber.scss

@@ -0,0 +1,16 @@
+page {
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
+	background-color: #fff;
+	font-size: 36rpx;
+	font-weight: 700;
+	box-sizing: border-box;
+	padding: 0 50rpx;
+}
+
+image {
+	width: 500rpx;
+	height: 500rpx;
+}

+ 36 - 0
pages/tabbar/mine/associatedPublicNumber.wxml

@@ -0,0 +1,36 @@
+<view wx:if="{{text}}" style="margin-top: 400rpx;">
+    {{text}}
+</view>
+<block wx:else>
+    <image style="margin-top: 50rpx;" src="https://yostest175549.obs.cn-east-2.myhuaweicloud.com:443/202306131686620036790B2108907.jpg" show-menu-by-longpress />
+    <block wx:if="{{code}}">
+        <view>
+            查询到还未关注公众号
+        </view>
+        <view style="margin-bottom: 30rpx;margin-top: 20rpx;">
+            请先关注公众号后进行绑定
+        </view>
+        <view>
+            请长按二维码识别图中公众号
+        </view>
+        <view style="margin-top: 20rpx;">
+            前去关注
+        </view>
+    </block>
+    <block wx:else>
+        <view>
+            已成功绑定消息通知
+        </view>
+        <view style="margin-bottom: 30rpx;margin-top: 20rpx;">
+            应用消息请关注公众号信息
+        </view>
+        <view>
+            请长按二维码识别图中公众号
+        </view>
+
+        <view style="margin-top: 20rpx;">
+            前去查看信息
+        </view>
+    </block>
+
+</block>

+ 6 - 1
pages/tabbar/mine/index.js

@@ -148,5 +148,10 @@ Page({
 			}
 		})
 	},
-	onShareAppMessage() {}
+	/* 前去查询 */
+	bindingOfficialAccounts() {
+		wx.navigateTo({
+			url: './webView',
+		})
+	}
 })

+ 62 - 52
pages/tabbar/mine/index.wxml

@@ -1,61 +1,71 @@
 <view class="user-box">
-    <navigator url="#" class="user-con" bindtap="changeUserMsg">
-        <van-image image-class="v-img" round width="128rpx" height="128rpx" src="{{userMsg.attinfos[0].url||'/static/image/user.png'}}" />
-        <view class="user-msg">
-            <view class="user-name">
-                {{userMsg.name}}<text>{{userMsg.hr.position}}</text>
-            </view>
-            <view class="user-phone">
-                {{userMsg.phonenumber}}
-            </view>
-        </view>
-        <van-icon size='40rpx' name="arrow" />
-    </navigator>
+	<navigator url="#" class="user-con" bindtap="changeUserMsg">
+		<van-image image-class="v-img" round width="128rpx" height="128rpx" src="{{userMsg.attinfos[0].url||'/static/image/user.png'}}" />
+		<view class="user-msg">
+			<view class="user-name">
+				{{userMsg.name}}<text>{{userMsg.hr.position}}</text>
+			</view>
+			<view class="user-phone">
+				{{userMsg.phonenumber}}
+			</view>
+		</view>
+		<van-icon size='40rpx' name="arrow" />
+	</navigator>
 </view>
 
 <view class="operating">
-    <navigator class="item" wx:if="{{userMsg.enterprise.sys_enterpriseid}}" url="/pages/tabbar/mine/address/index?id={{userMsg.enterprise.sys_enterpriseid}}">
-        <view class="con">
-            <view class="label">
-                <text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #085CDF;" />
-                我的地址
-            </view>
-            <view class="item-right">
-                <van-icon size='30rpx' name="arrow" />
-            </view>
-        </view>
-    </navigator>
-    <navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">
-        <view class="con">
-            <view class="label">
-                <text class="iconfont {{item.icon}}" style="color: {{item.color}};" />
-                {{item.name}}
-            </view>
-            <view class="item-right">
-                <van-icon size='30rpx' name="arrow" />
-            </view>
-        </view>
-    </navigator>
-
-    <navigator class="item" url="#" bindtap="bindingWechat">
-        <view class="con">
-            <view class="label">
-                <text class="iconfont icon-a-wodebangdingweixin" style="color: var(--success);" />
-                绑定微信
-                <view wx:if="{{userMsg.iswechatbinding}}" class="bd-wechat">已绑定</view>
-            </view>
-            <view class="item-right">
-                <image class="user-img" wx:if="{{userMsg.iswechatbinding}}" src="{{userMsg.wechatuserinfo.avatarUrl}}" />
-                <view class="tips right-false" wx:else>
-                    未绑定
-                </view>
-                <van-icon size='30rpx' name="arrow" />
-            </view>
-        </view>
-    </navigator>
+	<navigator class="item" wx:if="{{userMsg.enterprise.sys_enterpriseid}}" url="/pages/tabbar/mine/address/index?id={{userMsg.enterprise.sys_enterpriseid}}">
+		<view class="con">
+			<view class="label">
+				<text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #085CDF;" />
+				我的地址
+			</view>
+			<view class="item-right">
+				<van-icon size='30rpx' name="arrow" />
+			</view>
+		</view>
+	</navigator>
+	<navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">
+		<view class="con">
+			<view class="label">
+				<text class="iconfont {{item.icon}}" style="color: {{item.color}};" />
+				{{item.name}}
+			</view>
+			<view class="item-right">
+				<van-icon size='30rpx' name="arrow" />
+			</view>
+		</view>
+	</navigator>
 
+	<navigator class="item" url="#" bindtap="bindingWechat">
+		<view class="con">
+			<view class="label">
+				<text class="iconfont icon-a-wodebangdingweixin" style="color: var(--success);" />
+				绑定微信
+				<view wx:if="{{userMsg.iswechatbinding}}" class="bd-wechat">已绑定</view>
+			</view>
+			<view class="item-right">
+				<image class="user-img" wx:if="{{userMsg.iswechatbinding}}" src="{{userMsg.wechatuserinfo.avatarUrl}}" />
+				<view class="tips right-false" wx:else>
+					未绑定
+				</view>
+				<van-icon size='30rpx' name="arrow" />
+			</view>
+		</view>
+	</navigator>
+	<navigator wx:if="{{userMsg.iswechatbinding}}" class="item" url="#" bindtap="bindingOfficialAccounts">
+		<view class="con">
+			<view class="label">
+				<text class="iconfont icon-a-wodebangdingweixin" style="color: var(--success);" />
+				消息通知设置
+			</view>
+			<view class="item-right">
+				<van-icon size='30rpx' name="arrow" />
+			</view>
+		</view>
+	</navigator>
 </view>
 <view style="width: 100vw;text-align: center;margin-top: 200rpx;">
-    <van-button custom-class='out-login' color="#CCC" bindtap="outLogin" plain>退出登录</van-button>
+	<van-button custom-class='out-login' color="#CCC" bindtap="outLogin" plain>退出登录</van-button>
 </view>
 <view style="height: 140rpx;" />

+ 8 - 0
pages/tabbar/mine/webView.js

@@ -0,0 +1,8 @@
+Page({
+  data: {
+
+  },
+  onLoad(options) {
+      
+  },
+})

+ 4 - 0
pages/tabbar/mine/webView.json

@@ -0,0 +1,4 @@
+{
+	"usingComponents": {},
+	"navigationBarTitleText": "关联公众号"
+}

+ 1 - 0
pages/tabbar/mine/webView.scss

@@ -0,0 +1 @@
+/* pages/tabbar/mine/webView.wxss */

+ 1 - 0
pages/tabbar/mine/webView.wxml

@@ -0,0 +1 @@
+<web-view src="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxfe6432513507d553&redirect_uri=http://oms.idcgroup.com.cn/getcode.html&response_type=code&scope=snsapi_base&state=#wechat_redirect"/>