Browse Source

Merge branch '消息提醒'

xiaohaizhao 1 năm trước cách đây
mục cha
commit
1cc0d629ac

+ 3 - 1
app.json

@@ -14,7 +14,9 @@
     "pages/address/update",
     "pages/index/userCenter/changePassword/index",
     "pages/bankAccount/index",
-    "pages/bankAccount/update"
+    "pages/bankAccount/update",
+    "pages/notifications/webview",
+    "pages/notifications/associatedPublicNumber"
   ],
   "subpackages": [
     {

+ 12 - 0
pages/index/userCenter/index.wxml

@@ -64,6 +64,18 @@
 				</view>
 			</view>
 		</navigator>
+
+		<navigator wx:if="{{userMsg.iswechatbinding}}" class="item" url="/pages/notifications/webview">
+			<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>

+ 36 - 0
pages/notifications/associatedPublicNumber.js

@@ -0,0 +1,36 @@
+const _Http = getApp().globalData.http;
+
+Page({
+    data: {
+        text: "",
+        code: ""
+    },
+    onLoad(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/notifications/associatedPublicNumber.json

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

+ 16 - 0
pages/notifications/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;
+}

+ 35 - 0
pages/notifications/associatedPublicNumber.wxml

@@ -0,0 +1,35 @@
+<view wx:if="{{text}}" style="margin-top: 400rpx;">
+    {{text}}
+</view>
+<block wx:else>
+    <image style="margin-top: 50rpx;" src="/static/gzh.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>

+ 2 - 0
pages/notifications/webview.js

@@ -0,0 +1,2 @@
+Page({
+})

+ 4 - 0
pages/notifications/webview.json

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

+ 1 - 0
pages/notifications/webview.scss

@@ -0,0 +1 @@
+/* pages/notifications/webview.wxss */

+ 1 - 0
pages/notifications/webview.wxml

@@ -0,0 +1 @@
+<web-view src="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8d848a89fcbf6bd8&redirect_uri=https://www.cnd3b.com/getcode.html&response_type=code&Scope=snsapi_base&state=12312#wechat_redirect" />

BIN
static/gzh.jpg