Commit 48276b9f by 赵雅纹

Merge branch 'dev_7.1.0' into feature-zyw-sc

parents 06707e1d d2f7efdc
...@@ -46,56 +46,7 @@ Component({ ...@@ -46,56 +46,7 @@ Component({
*/ */
methods: { methods: {
_getUserInfo(res = {}) { _getUserInfo(res = {}) {
const userInfo = res.detail || {} this.triggerEvent('getAuth', res);
console.log('userInfo',userInfo)
// 先授权再领卡
if (res.detail.userInfo) {
utils.getUserInfoByBtn(userInfo).then( (data = {} ) => {
const {token} = data
wx.setStorageSync('_accreditUserInfo', userInfo)
wx.hideNavigationBarLoading()
if (token) {
wx.setStorageSync('token', token)
} else {
wx.setStorageSync('token', '')
}
wx.setStorageSync('_baseUserInfo', data) // 缓存用户信息
this.setUserInfo() // 判断有无开卡
}).catch(err=> {
if (err) {
wx.showToast({
title: `会员系统异常请稍后重试!`,
icon: 'none'
})
}
})
}
},
setUserInfo () {
const userInfo = wx.getStorageSync('_baseUserInfo')
// 新用户去激活领卡
if (userInfo && userInfo.member && !userInfo.member.mobile) {
console.log('去开')
wxService.openCard()
return false
}else {
console.log('已开')
}
// 跳转
const urls = getCurrentPages()
setTimeout(() => {
const item = urls[0].options
if (item.route) {
try {
const options = JSON.parse(item.options)
wxService.router(`/${item.route}`).search(options).replace()
} catch (e) {
wxService.router('/pages/userCenter/userCenter').replace()
}
} else {
wxService.router('/pages/userCenter/userCenter').replace()
}
}, 200)
}, },
handelToPage(event){ handelToPage(event){
const ev = event.currentTarget.dataset; const ev = event.currentTarget.dataset;
......
function hanlerLinkNeedAuth(link){ function hanlerLinkNeedAuth(link){
console.log('linkwwwwwwwwwww', link)
var flag = false var flag = false
if(link.indexOf('pages/my/my') > -1 || link.indexOf('pages/cart/cart') > -1 ){ if(link.indexOf('pages/my/my') > -1 || link.indexOf('pages/cart/cart') > -1 ){
flag = true flag = true
} }
console.log('flag', flag)
return flag return flag
} }
......
// component/skuPopup/skuPopup.js // component/skuPopup/skuPopup.js
// import { ReportModel } from '../../utils/reportModel' // import { ReportModel } from '../../utils/reportModel'
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
currentHasUserInfo:{
type: Boolean,
type: false
},
disableNum: { // 不能改变的数量 disableNum: { // 不能改变的数量
type: Number, type: Number,
observer: '_disableNumChange', observer: '_disableNumChange',
...@@ -373,6 +378,9 @@ Component({ ...@@ -373,6 +378,9 @@ Component({
// } // }
this.setData(updateData) this.setData(updateData)
console.log('666', updateData.skuStock) console.log('666', updateData.skuStock)
},
_getUserInfo(res = {}) {
this.triggerEvent('getAuth', res);
} }
} }
}) })
<!--component/skuPopup/skuPopup.wxml--> <!--component/skuPopup/skuPopup.wxml-->
<view class="popup-container{{show ? ' active' : ''}}" bindtap="hidePopup"></view> <view class="popup-container{{show ? ' active' : ''}}" bindtap="hidePopup" />
<view class="popup-content{{show ? ' active' : ''}}"> <view class="popup-content{{show ? ' active' : ''}}">
<image class="popup-close" mode="widthFix" src="/images/close.png" bindtap="hidePopup"></image> <image
class="popup-close"
mode="widthFix"
src="/images/close.png"
bindtap="hidePopup"
/>
<view class="top-info clearfix"> <view class="top-info clearfix">
<image mode="widthFix" src="{{curSku.sku_pic_url && curSku.sku_pic_url != 'undefined' ? (imageDomain + curSku.sku_pic_url) : indexImg}}"></image> <image mode="widthFix" src="{{curSku.sku_pic_url && curSku.sku_pic_url != 'undefined' ? (imageDomain + curSku.sku_pic_url) : indexImg}}" />
<view class="top-text"> <view class="top-text">
<!-- <view class="price-text" wx:if="{{exchangePrice <= 0}}">¥{{price / 100}}</view> --> <!-- <view class="price-text" wx:if="{{exchangePrice <= 0}}">¥{{price / 100}}</view> -->
<view class="price-text">¥{{salePrice}}</view> <view class="price-text">¥{{salePrice}}</view>
<view class="stock-text">库存:{{skuStock}}</view> <view class="stock-text">库存:{{skuStock}}</view>
<view class="sku-text">规格:<block wx:for="{{skuText}}" wx:key="{{index}}">{{item}} </block></view> <view class="sku-text">规格:
</view> <block wx:for="{{skuText}}" wx:key="{{index}}">{{item}} </block>
</view> </view>
<!-- isAllowArrive 0 开启/放开 1 关闭/禁用 --> </view>
<scroll-view class="mid-info" scroll-y="true"> </view>
<view class="sku-info" wx:for="{{specItem}}" wx:for-index="i" wx:key="{{i}}"> <!-- isAllowArrive 0 开启/放开 1 关闭/禁用 -->
<view class="spec-name">{{item.name}}</view> <scroll-view class="mid-info" scroll-y="true">
<view class="spec-values" wx:for="{{item.sonList}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue"> <view
<view class="spec-value {{specValue.stock == 0 ? ' disabled' : ''}}{{curSpec[i].name == specValue.name ? ' active' : ''}}" bindtap="selectSku" data-id="{{specValue.id}}" data-index="{{i}}" data-name="{{specValue.name}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 ? true : false}}" data-stock="{{skuStock}}">{{specValue.name}}</view> class="sku-info"
wx:for="{{specItem}}"
wx:for-index="i"
wx:key="{{i}}"
>
<view class="spec-name">{{item.name}}</view>
<view
class="spec-values"
wx:for="{{item.sonList}}"
wx:for-index="j"
wx:key="{{j}}"
wx:for-item="specValue"
>
<view
class="spec-value {{specValue.stock == 0 ? ' disabled' : ''}}{{curSpec[i].name == specValue.name ? ' active' : ''}}"
bindtap="selectSku"
data-id="{{specValue.id}}"
data-index="{{i}}"
data-name="{{specValue.name}}"
data-type="{{goodType}}"
data-disable="{{specValue.skuStock == 0 ? true : false}}"
data-stock="{{skuStock}}"
>{{specValue.name}}
</view>
<!-- <view wx:if="{{isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> --> <!-- <view wx:if="{{isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> -->
<!-- <view wx:if="{{!isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 && goodType == 2 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> --> <!-- <view wx:if="{{!isAllowArrive}}" class="spec-value{{specValue.skuStock == 0 ? ' disabled' : ''}}{{curSpec[i] == specValue.skuName ? ' active' : ''}}" wx:for="{{specInfo.specValue}}" wx:for-index="j" wx:key="{{j}}" wx:for-item="specValue" data-stock="{{specValue.skuStock}}" data-name="{{specValue.skuName}}" data-index="{{i}}" data-type="{{goodType}}" data-disable="{{specValue.skuStock == 0 && goodType == 2 ? true : false}}" bindtap="selectSku">{{specValue.skuName}}</view> -->
</view> </view>
</view> </view>
<!-- <view class="sku-number"> <!-- <view class="sku-number">
<view class="spec-name">数量</view> <view class="spec-name">数量</view>
<view class="num-panel clearfix"> <view class="num-panel clearfix">
<button bindtap="minusNum">-</button> <button bindtap="minusNum">-</button>
...@@ -31,17 +59,29 @@ ...@@ -31,17 +59,29 @@
<button bindtap="addNum">+</button> <button bindtap="addNum">+</button>
</view> </view>
</view> --> </view> -->
<view class="sku-number"> <view class="sku-number">
<view class="spec-name">数量</view> <view class="spec-name">数量</view>
<view class="num-panel"> <view class="num-panel">
<button bindtap="minusNum">-</button> <button bindtap="minusNum">-</button>
<input value="{{proNum}}" type="number" bindblur="inputNum"></input> <input value="{{proNum}}" type="number" bindblur="inputNum" />
<button bindtap="addNum">+</button> <button bindtap="addNum">+</button>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<!-- 按钮状态 -->
<!-- 按钮状态 --> <view wx:if="{{!currentHasUserInfo}}">
<button class="confirm-button {{isOutStock? 'out-stock': ''}}" bindtap="confirm">{{btnText}}</button> <button
bindgetuserinfo="_getUserInfo"
data-jflag="false"
open-type='getUserInfo'
class="confirm-button {{isOutStock? 'out-stock': ''}}"
hover-class="btn-hover"
>
{{btnText}}
</button>
</view>
<view wx:else>
<button class="confirm-button {{isOutStock? 'out-stock': ''}}" bindtap="confirm">{{btnText}}</button>
</view>
</view> </view>
{ {
"navigationBarTitleText": "订单详情", "navigationBarTitleText": "物流详情",
"usingComponents": { "usingComponents": {
"go-home": "/component/goHome/goHome" "go-home": "/component/goHome/goHome"
} }
......
...@@ -144,8 +144,8 @@ wxService.page({ ...@@ -144,8 +144,8 @@ wxService.page({
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => { // /mainSetting/page?brandId=&isMain=&type=2
wxService.post(`/merchant/modelPage/mainSetting/mall?brandId=${app.globalData.brandId}`).then(res => { wxService.post(`/merchant/modelPage/mainSetting/page?brandId=${app.globalData.brandId}&isMain=2&type=2`).then(res => {
if (!res) return false if (!res) return false
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
...@@ -237,7 +237,6 @@ wxService.page({ ...@@ -237,7 +237,6 @@ wxService.page({
if (res && res.tentacleId) { if (res && res.tentacleId) {
let tentacleId = Integer.digit(res.tentacleId, 10, 64); let tentacleId = Integer.digit(res.tentacleId, 10, 64);
var path = `pages/userCenter/userCenter?t=${tentacleId}`; var path = `pages/userCenter/userCenter?t=${tentacleId}`;
console.log(path)
return { return {
path: path path: path
} }
......
...@@ -81,7 +81,6 @@ wxService.page({ ...@@ -81,7 +81,6 @@ wxService.page({
} }
}, },
touchM: function (e) { touchM: function (e) {
console.log('333', e)
if (e.touches.length == 1) { if (e.touches.length == 1) {
//手指移动时y方向位置 //手指移动时y方向位置
var moveY = e.touches[0].clientY; var moveY = e.touches[0].clientY;
...@@ -90,12 +89,10 @@ wxService.page({ ...@@ -90,12 +89,10 @@ wxService.page({
var delBtnWidth = this.data.delBtnWidth; var delBtnWidth = this.data.delBtnWidth;
var moveDistance = delBtnWidth - disY; var moveDistance = delBtnWidth - disY;
var txtStyle = ""; var txtStyle = "";
console.log('------', disY)
if (disY == 0 || disY < 0) { //如果移动距离小于等于0,文本层位置不变 if (disY == 0 || disY < 0) { //如果移动距离小于等于0,文本层位置不变
txtStyle = "margin-top:-" + delBtnWidth; txtStyle = "margin-top:-" + delBtnWidth;
} else if (disY > 0) { //移动距离大于0,文本层left值等于手指移动距离 } else if (disY > 0) { //移动距离大于0,文本层left值等于手指移动距离
txtStyle = "margin-top:-" + moveDistance + "px"; txtStyle = "margin-top:-" + moveDistance + "px";
console.log('+++', txtStyle)
if (disY >= delBtnWidth) { if (disY >= delBtnWidth) {
//控制手指移动距离最大值为删除按钮的宽度 //控制手指移动距离最大值为删除按钮的宽度
txtStyle = "margin-top:0px" ; txtStyle = "margin-top:0px" ;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
var app = getApp() var app = getApp()
const wxService = require('../../utils/wxService') const wxService = require('../../utils/wxService')
import { Integer } from '../../utils/integerDigitalConvertion' import { Integer } from '../../utils/integerDigitalConvertion'
const utils = require('../../utils/util')
wxService.page({ wxService.page({
/** /**
...@@ -103,6 +103,7 @@ wxService.page({ ...@@ -103,6 +103,7 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
console.log('0this.data.currentHasUserInfo', this.data.currentHasUserInfo)
this.getProInfo() this.getProInfo()
this.getOpenStatus() this.getOpenStatus()
this.data.currentShareContent = null this.data.currentShareContent = null
......
...@@ -156,6 +156,8 @@ ...@@ -156,6 +156,8 @@
bind:skuselect="confirmClick" bind:skuselect="confirmClick"
btn-text="{{btnText}}" btn-text="{{btnText}}"
product-stock="{{productInfo.stock}}" product-stock="{{productInfo.stock}}"
currentHasUserInfo="{{currentHasUserInfo}}"
bind:getAuth="_getUserInfo"
/> />
<card-modal <card-modal
......
...@@ -75,7 +75,7 @@ wxService.page({ ...@@ -75,7 +75,7 @@ wxService.page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
console.log('0this.data.currentHasUserInfo', this.data.currentHasUserInfo)
// 取会员卡号 // 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo') const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const cardMember = wx.getStorageSync('_cardMember') const cardMember = wx.getStorageSync('_cardMember')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<bottom bottom="{{pItem.bottom}}" /> <bottom bottom="{{pItem.bottom}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 5}}"> <view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs currHomePageId="{{currHomePageId}}" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/> <bottom-tabs currHomePageId="{{currHomePageId}}" bind:getAuth="_getUserInfo" currentHasUserInfo="{{currentHasUserInfo}}" tab-bar="{{pItem.tabBar}}" bind:updatePage="updatePage"/>
</view> </view>
<view class="" wx:if="{{pItem.type == 6}}"> <view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" /> <announcement notice="{{pItem.notice}}" />
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
"id": 13, "id": 13,
"name": "subPage", "name": "subPage",
"pathName": "subPackage/page/pages/subPage/subPage", "pathName": "subPackage/page/pages/subPage/subPage",
"query": "pageId=22", "query": "pageId=17",
"scene": null "scene": null
}, },
{ {
......
{ {
"navigationBarTitleText": "plus 购买页" "navigationBarTitleText": "h5"
} }
\ No newline at end of file
...@@ -29,9 +29,9 @@ function getCurrentPageUrlWithArgs() { ...@@ -29,9 +29,9 @@ function getCurrentPageUrlWithArgs() {
var url = currentPage.route // 当前页面url var url = currentPage.route // 当前页面url
var options = currentPage.options // 如果要获取url中所带的参数可以查看options var options = currentPage.options // 如果要获取url中所带的参数可以查看options
/** /**
* 拼接url的参数 * 拼接url的参数
*/ */
var urlWithArgs = url + '?' var urlWithArgs = url + '?'
for (var key in options) { for (var key in options) {
var value = options[key] var value = options[key]
...@@ -52,35 +52,35 @@ function getAccountInfo() { ...@@ -52,35 +52,35 @@ function getAccountInfo() {
/** /**
* 图片宽高比 * 图片宽高比
*/ */
function imageUtil(e) { function imageUtil(e) {
var imageSize = {}; var imageSize = {};
var originalWidth = e.detail.width;//图片原始宽 var originalWidth = e.detail.width;//图片原始宽
var originalHeight = e.detail.height;//图片原始高 var originalHeight = e.detail.height;//图片原始高
var originalScale = originalHeight/originalWidth;//图片高宽比 var originalScale = originalHeight / originalWidth;//图片高宽比
//获取屏幕宽高 //获取屏幕宽高
wx.getSystemInfo({ wx.getSystemInfo({
success: function (res) { success: function (res) {
// var windowWidth = res.windowWidth/2; // var windowWidth = res.windowWidth/2;
// var windowHeight = res.windowHeight/2; // var windowHeight = res.windowHeight/2;
// var windowWidth = (res.windowWidth - 30)/2; // var windowWidth = (res.windowWidth - 30)/2;
var windowWidth = (res.windowWidth - 15)/2; var windowWidth = (res.windowWidth - 15) / 2;
var windowHeight = res.windowHeight/2; var windowHeight = res.windowHeight / 2;
var windowscale = windowHeight/windowWidth;//屏幕高宽比 var windowscale = windowHeight / windowWidth;//屏幕高宽比
if(originalScale < windowscale){//图片高宽比小于屏幕高宽比 if (originalScale < windowscale) {//图片高宽比小于屏幕高宽比
//图片缩放后的宽为屏幕宽 //图片缩放后的宽为屏幕宽
imageSize.imageWidth = windowWidth; imageSize.imageWidth = windowWidth;
imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth; imageSize.imageHeight = (windowWidth * originalHeight) / originalWidth;
}else{//图片高宽比大于屏幕高宽比 } else {//图片高宽比大于屏幕高宽比
//图片缩放后的高为屏幕高 //图片缩放后的高为屏幕高
// imageSize.imageHeight = windowHeight; // imageSize.imageHeight = windowHeight;
// imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight; // imageSize.imageWidth = (windowHeight * originalWidth) / originalHeight;
imageSize.imageHeight = originalHeight * windowWidth / originalWidth; imageSize.imageHeight = originalHeight * windowWidth / originalWidth;
imageSize.imageWidth = windowWidth; imageSize.imageWidth = windowWidth;
} }
} }
}) })
return imageSize; return imageSize;
} }
/** /**
* 判断用户滑动 * 判断用户滑动
...@@ -99,12 +99,12 @@ function getTouchData(endX, endY, startX, startY) { ...@@ -99,12 +99,12 @@ function getTouchData(endX, endY, startX, startY) {
/** /**
* view宽高比 * view宽高比
*/ */
function aspectRatio(h,w) { function aspectRatio(h, w) {
let viewStyle = {} let viewStyle = {}
let originalScale = h/w let originalScale = h / w
wxService.getSystemInfo().then(res=>{ wxService.getSystemInfo().then(res => {
let windowscale = res.windowHeight/res.windowWidth let windowscale = res.windowHeight / res.windowWidth
if(originalScale < windowscale){ if (originalScale < windowscale) {
viewStyle.width = res.windowWidth viewStyle.width = res.windowWidth
viewStyle.height = (res.windowWidth * h) / w; viewStyle.height = (res.windowWidth * h) / w;
} else { } else {
...@@ -118,11 +118,11 @@ function aspectRatio(h,w) { ...@@ -118,11 +118,11 @@ function aspectRatio(h,w) {
/** /**
* 解析 url 参数 * 解析 url 参数
*/ */
function parseUrl(query){ function parseUrl(query) {
var result = []; var result = [];
// var query = url.split("?")[1]; // var query = url.split("?")[1];
var queryArr = query.split("&"); var queryArr = query.split("&");
queryArr.forEach(function(item){ queryArr.forEach(function (item) {
var obj = {}; var obj = {};
var value = item.split("=")[0]; var value = item.split("=")[0];
var key = item.split("=")[1]; var key = item.split("=")[1];
...@@ -284,7 +284,62 @@ const formatNumber = n => { ...@@ -284,7 +284,62 @@ const formatNumber = n => {
return n[1] ? n : '0' + n return n[1] ? n : '0' + n
} }
function _getUserInfo(ev) {
console.log('iiiiiiiiiiiiii', ev)
const userInfo = ev.detail
return getUserInfoByBtn(userInfo).then((data = {}) => {
const { token } = data
wx.setStorageSync('_accreditUserInfo', userInfo)
wx.hideNavigationBarLoading()
if (token) {
wx.setStorageSync('token', token)
} else {
wx.setStorageSync('token', '')
}
wx.setStorageSync('_baseUserInfo', data) // 缓存用户信息
setUserInfo() // 判断有无开卡
}).catch(err => {
if (err) {
wx.showToast({
title: `会员系统异常请稍后重试!`,
icon: 'none'
})
}
})
}
function setUserInfo() {
const userInfo = wx.getStorageSync('_baseUserInfo')
// 新用户去激活领卡
if (userInfo && userInfo.member && !userInfo.member.mobile) {
console.log('去开')
wxService.openCard()
return false
} else {
console.log('已开')
}
// 跳转
const urls = getCurrentPages()
setTimeout(() => {
const item = urls[0].options
const route = urls[0].route
console.log('----------item', route, item)
if (route) {
try {
const options = item
wxService.router(`/${route}`).search(options).replace()
} catch (e) {
wxService.router('/pages/userCenter/userCenter').replace()
}
} else {
wxService.router('/pages/userCenter/userCenter').replace()
}
}, 200)
}
wxService.setGetAuthUserInfo(_getUserInfo);
module.exports = { module.exports = {
_getUserInfo,
formatTime, formatTime,
getCurrentPageUrl, getCurrentPageUrl,
getCurrentRouter, getCurrentRouter,
......
...@@ -20,6 +20,7 @@ const citysData = require('./city.js') ...@@ -20,6 +20,7 @@ const citysData = require('./city.js')
import { Integer } from './integerDigitalConvertion' import { Integer } from './integerDigitalConvertion'
let openCardLister = null let openCardLister = null
/** /**
* 单例 * 单例
*/ */
...@@ -29,11 +30,15 @@ class WXService extends Http { ...@@ -29,11 +30,15 @@ class WXService extends Http {
super() super()
this.Promise = Promise this.Promise = Promise
this.currentPage = null this.currentPage = null
this.getAuthUserInfo = null
} }
getToken() { getToken() {
return super.getToken() return super.getToken()
} }
setGetAuthUserInfo(getAuthUserInfo) {
this.getAuthUserInfo = getAuthUserInfo;
}
/** /**
* 所有接口中返回401就登录 * 所有接口中返回401就登录
...@@ -281,7 +286,7 @@ class WXService extends Http { ...@@ -281,7 +286,7 @@ class WXService extends Http {
wx.setStorageSync('TENTACLE_CONTENT', storageObj) wx.setStorageSync('TENTACLE_CONTENT', storageObj)
wx.setStorageSync('TIME_EXPIRATION', expiration) wx.setStorageSync('TIME_EXPIRATION', expiration)
} }
else{ else {
wx.removeStorageSync('TENTACLE_CONTENT') wx.removeStorageSync('TENTACLE_CONTENT')
wx.removeStorageSync('TIME_EXPIRATION') wx.removeStorageSync('TIME_EXPIRATION')
} }
...@@ -290,22 +295,22 @@ class WXService extends Http { ...@@ -290,22 +295,22 @@ class WXService extends Http {
}) })
} }
//根据页面类型判断content取值 //根据页面类型判断content取值
getContentByContentType(item){ getContentByContentType(item) {
//1,2,3,8,9,10,11 页面 取页面标题 //1,2,3,8,9,10,11 页面 取页面标题
if (item.contentType == 1 || item.contentType == 2 || item.contentType == 3 || item.contentType == 8 || item.contentType == 9 || item.contentType == 10 || item.contentType == 11 ){ if (item.contentType == 1 || item.contentType == 2 || item.contentType == 3 || item.contentType == 8 || item.contentType == 9 || item.contentType == 10 || item.contentType == 11) {
item.content = item.content item.content = item.content
} }
// 详情 // 详情
if (item.contentType == 4 || item.contentType == 6 ){ if (item.contentType == 4 || item.contentType == 6) {
let content = JSON.parse(item.content) let content = JSON.parse(item.content)
item.contentArr = [content] item.contentArr = [content]
} }
// 内容列表 // 内容列表
if (item.contentType == 5){ if (item.contentType == 5) {
if (item.contentId){ if (item.contentId) {
let content = JSON.parse(item.content) let content = JSON.parse(item.content)
item.contentArr = [content] item.contentArr = [content]
}else{ } else {
item.content = item.content item.content = item.content
} }
} }
...@@ -319,7 +324,7 @@ class WXService extends Http { ...@@ -319,7 +324,7 @@ class WXService extends Http {
} }
} }
} }
//更新本地触点对象信息 //更新本地触点对象信息
updateLocalTentacleInfo() { updateLocalTentacleInfo() {
//先获取本地触点对象信息 //先获取本地触点对象信息
...@@ -628,6 +633,10 @@ class WXService extends Http { ...@@ -628,6 +633,10 @@ class WXService extends Http {
console.error(e) console.error(e)
} }
} }
},
//统一处理用户授权获取用户信息回调
_getUserInfo(res) {
_self.getAuthUserInfo(res.detail)
} }
} }
Page(Object.assign({}, config, CONFIG_PAPGE)) Page(Object.assign({}, config, CONFIG_PAPGE))
......
function date(time,format){ function date(time,format){
var date = getDate(time); var date = getDate(time);
// console.log(date);
return date.getFullYear() + '-' + date.getMonth() + 1 + '-'+ date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' +date.getSeconds(); return date.getFullYear() + '-' + date.getMonth() + 1 + '-'+ date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' +date.getSeconds();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment