From 745a11a4fb809beb35c8c0a8f17f1b8cda15667e Mon Sep 17 00:00:00 2001
From: xpz2018 <107107461@qq.com>
Date: Tue, 12 Jan 2021 15:16:09 +0800
Subject: [PATCH] no message
---
app.js | 2 +-
components/popup/index.wxss | 4 +--
pages/index/index.js | 49 ++++++++++++++++++++++++++++++++-----
pages/index/index.json | 4 ++-
pages/index/index.wxml | 33 +++++++++++++++++++++----
pages/index/index.wxss | 27 ++++++++++++++++++++
utils/request.js | 9 ++++++-
7 files changed, 112 insertions(+), 16 deletions(-)
diff --git a/app.js b/app.js
index 733317f..6ecce42 100644
--- a/app.js
+++ b/app.js
@@ -1,7 +1,7 @@
//app.js
App({
//----------------------------------------------globalData--------------------------------------
- release: 1,
+ release: 0,
httpUrl: 'https://api.qniao.cn',
tmplIds: ['SUjEgwDopCv9xkkSZ4KbS0L7XbAiVQor6GmPg14K760'],
agentMsgIds: ['kG8DErWDpyzBHCFaLlSKYMF7xVy8UpgogCwV_WSNt10', 'oLbv-IyJOia2tenh64_Lc8xeAzwgzu3gh1vFJ1Se-ME'],
diff --git a/components/popup/index.wxss b/components/popup/index.wxss
index eaba04a..21a68d2 100644
--- a/components/popup/index.wxss
+++ b/components/popup/index.wxss
@@ -1,8 +1,8 @@
.wux-popup {
position: fixed;
z-index: 1000;
- width: 80%;
- max-width: 600rpx
+ width: 100%;
+ max-width: 680rpx
}
.wux-popup-position.wux-popup-position--center .wux-popup {
top: 50%;
diff --git a/pages/index/index.js b/pages/index/index.js
index 2702d83..17b6481 100644
--- a/pages/index/index.js
+++ b/pages/index/index.js
@@ -13,7 +13,9 @@ Page({
pageIndex: 1,
safeBottom: app.globalData.safeBottom,
inited: false,
- path: null
+ path: null,
+ landInfo: null,
+ visible: false
},
/************************************** 初始化流程 ********************************************/
onLoad: function (options) {
@@ -71,7 +73,7 @@ Page({
this.fetchUserInfo()
} else {
wx.hideLoading()
- this.onResume()
+ this.toIndex()
}
}
})
@@ -92,15 +94,36 @@ Page({
fetchUserInfo:function(){
request.get('/recycle-service/user/get/base-info').then(result => {
app.globalData.userInfo = result.data
- wx.hideLoading()
- this.onResume()
- if(this.data.path){
- wx.navigateTo({ url: this.data.path })
+ var accessToken = wx.getStorageSync('accessToken')
+ if(accessToken){
+ app.globalData.userToken = accessToken
+ request.get('/saas-trade/receive/v150/get/OrderExists').then(result => {
+ wx.hideLoading()
+ if (Number(result.data) != 1 || !app.release) {
+ this.toIndex()
+ } else {
+ wx.reLaunch({ url: '/pages/paper/index' })
+ }
+ }).catch(err => {
+ //异常回调
+ wx.hideLoading()
+ this.toIndex()
+ })
+ } else {
+ wx.hideLoading()
+ this.toIndex()
}
}).catch(err => {
wx.hideLoading()
})
},
+ toIndex: function(){
+ this.onResume()
+ if(this.data.path){
+ wx.navigateTo({ url: this.data.path })
+ }
+ // 进行弹窗的dialog显示处理;
+ },
onResume: function(){
var pageView = this.selectComponent('#' + this.data.TabList[this.data.pageIndex].value)
if (pageView && this.data.inited) {
@@ -128,5 +151,19 @@ Page({
},
stopTouchMove: function(e){
return false
+ },
+ // 弹出框的处理;
+ onClose: function(){
+ this.setData({ visible: false, landInfo: null })
+ },
+ onImageLoad: function(){
+ this.setData({ visible: true })
+ },
+ onImageClick: function(){
+ console.log(this.data.landInfo)
+ this.setData({ visible: false, landInfo: null })
+ },
+ toRule: function(){
+ console.log('toRule>>>')
}
})
diff --git a/pages/index/index.json b/pages/index/index.json
index ceb0ef4..4a41061 100644
--- a/pages/index/index.json
+++ b/pages/index/index.json
@@ -2,6 +2,8 @@
"usingComponents": {
"mall": "/pages/mall/index/index",
"article": "/pages/article/index/index",
- "home": "/pages/home/index/index"
+ "home": "/pages/home/index/index",
+ "wux-image": "/components/image/index",
+ "wux-popup": "/components/popup/index"
}
}
\ No newline at end of file
diff --git a/pages/index/index.wxml b/pages/index/index.wxml
index 1617041..a9c83a8 100644
--- a/pages/index/index.wxml
+++ b/pages/index/index.wxml
@@ -1,16 +1,39 @@
-
-
-
+
+
+
+
+
+
+
+
+
-
+
{{item.name}}
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+ 活动规则
+
+
\ No newline at end of file
diff --git a/pages/index/index.wxss b/pages/index/index.wxss
index e69de29..bd54354 100644
--- a/pages/index/index.wxss
+++ b/pages/index/index.wxss
@@ -0,0 +1,27 @@
+.wux-close {
+ width: 100%;
+ text-align: end;
+ display: inline-block;
+ padding-bottom: 24rpx;
+}
+
+.wux-landscape{
+ width: 100%;
+ max-width: 750rpx;
+}
+
+.wux-landscape__popup {
+ background-color: transparent!important
+}
+
+.wux-landscape__popup-body {
+ padding: 0!important
+}
+.wux-landscape__inner {
+ line-height: 1.5;
+ color: rgba(0,0,0,.65)
+}
+.wux-landscape__inner > image {
+ width: 100%;
+ max-width: 100%
+}
\ No newline at end of file
diff --git a/utils/request.js b/utils/request.js
index 97a5896..d0accc9 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -21,6 +21,12 @@ function fun(url, method, data, header) {
app.globalData.token = authorization
}
}
+ if(util.isEmpty(app.globalData.userToken)){
+ var userToken = wx.getStorageSync('userToken')
+ if (userToken) {
+ app.globalData.userToken = userToken
+ }
+ }
if(flag){
header = {
'X-APP-ID': app.xAppId,
@@ -29,7 +35,8 @@ function fun(url, method, data, header) {
}
} else {
header = {
- 'user-token': app.globalData.userToken,
+ 'X-APP-ID': app.xAppId,
+ 'user-token': '' + app.globalData.userToken,
appversion: app.version
}
}