@@ -11,7 +11,7 @@ export const getAnnounce = function(params) { | |||
// 获取在线人数 | |||
export const getOnlive = function(params) { | |||
return request({ | |||
url: '/index/westreamUser/onlineNum', | |||
url: '/westreamUser/onlineNum', | |||
method: 'GET', | |||
data:params | |||
}) |
@@ -9,12 +9,13 @@ export const getOpenId = function (code) { | |||
}) | |||
} | |||
/** | |||
* 获取openId | |||
* 获取用户信息 | |||
*/ | |||
export const getUserData = function (openid) { | |||
export const getUserData = function (params) { | |||
return request({ | |||
url: `/wx/westreamUser/${openid}`, | |||
url: '/westreamUser/userInfo', | |||
method: 'GET', | |||
data: params | |||
}) | |||
} | |||
/** | |||
@@ -39,11 +40,11 @@ export const getTenantData = function (data) { | |||
} | |||
/** | |||
* 进入小程序 | |||
* 进入小程序,记录次数 | |||
*/ | |||
export const enterMini = function (data) { | |||
return request({ | |||
url: '/index/member/login', | |||
url: '/westreamUser/login', | |||
method: 'POST', | |||
data | |||
}) |
@@ -8,4 +8,42 @@ export const getFeedbackIndex = function (params) { | |||
method: 'GET', | |||
params | |||
}) | |||
} | |||
// 上传个人信息 | |||
export const uploadUserInfo = function(data) { | |||
return request({ | |||
url: '/westreamUser/editInfo', | |||
method: 'PUT', | |||
data | |||
}) | |||
} | |||
/** | |||
* 获取身份列表 | |||
*/ | |||
export const getIdList = function () { | |||
return request({ | |||
url: '/identity/getList', | |||
method: 'GET' | |||
}) | |||
} | |||
// 申请身份 | |||
export const approveIdenty = function(data) { | |||
return request({ | |||
url: '/identity/submit', | |||
method: 'POST', | |||
data | |||
}) | |||
} | |||
/** | |||
* 获取身份申请记录(最新一条) | |||
*/ | |||
export const getIdApprove = function (data) { | |||
return request({ | |||
url: '/identity/getApplyLast', | |||
method: 'GET', | |||
data | |||
}) | |||
} |
@@ -8,26 +8,7 @@ App({ | |||
wx.setStorageSync('logs', logs) | |||
// 心跳更新在线状态 | |||
// setInterval(()=> { | |||
// const {times} = this.globalData | |||
// const openid = wx.getStorageSync('openId') | |||
// const positionParams = wx.getStorageSync('positionParams') | |||
// const {nickname, headimgurl} = wx.getStorageSync('userInfo') | |||
// const params = { | |||
// openid, | |||
// // nickname: nickname, | |||
// // headimgurl: headimgurl, | |||
// provinceCode: positionParams.provinceCode, | |||
// cityCode: positionParams.cityCode, | |||
// districtCode: positionParams.districtCode | |||
// } | |||
// if(openid) { | |||
// /* 更新用户省市区,一分钟一次 */ | |||
// if(times%60 === 0){ | |||
// IsOnlive(params) | |||
// } | |||
// } | |||
// }, 5000) | |||
}, | |||
globalData: { | |||
times: 0, |
@@ -14,7 +14,7 @@ | |||
"custom": true, | |||
"color": "#939393", | |||
"borderStyle": "white", | |||
"selectedColor": "#477DF3", | |||
"selectedColor": "#2a82e4", | |||
"list": [ | |||
{ | |||
"pagePath": "pages/FirstPage/index", | |||
@@ -58,7 +58,9 @@ | |||
"pages/submitSuccess/index", | |||
"pages/riverDetail/index", | |||
"pages/conceal/index", | |||
"pages/agree/index" | |||
"pages/agree/index", | |||
"pages/stores/index", | |||
"pages/storeDetail/index" | |||
] | |||
}, | |||
{ | |||
@@ -67,7 +69,13 @@ | |||
"pages/records/index", | |||
"pages/feedbackDetail/index", | |||
"pages/beauties/index", | |||
"pages/senceDetail/index" | |||
"pages/senceDetail/index", | |||
"pages/userInfo/index", | |||
"pages/myId/index", | |||
"pages/approveId/index", | |||
"pages/exchange/index", | |||
"pages/IdList/index", | |||
"pages/submitSuccess/index" | |||
] | |||
} | |||
], |
@@ -61,6 +61,11 @@ Component({ | |||
if (!this.data.more) return | |||
if (!this.data.loading && (!this.data.params || Object.keys(this.data.params).length > 0)) { | |||
this.setData({ loading: true }) | |||
// 增加租户id | |||
let {tenantId} = wx.getStorageSync('tenant') | |||
if(this.data?.params) { | |||
this.data.params.tenantId = tenantId | |||
} | |||
get(this.data.url, Object.assign({}, { page: this.data.page, limit: this.data.limit }, this.data.params || {})).then(res => { | |||
let records; | |||
if (res.code == 0) { |
@@ -1,10 +1,10 @@ | |||
const app = getApp(); | |||
import {getUserInfo} from '../utils/getUserInfo.js' | |||
import {getOpenidData} from '../utils/getUserInfo.js' | |||
Component({ | |||
data: { | |||
selected: 0, | |||
color: "#939393", | |||
selectedColor: "#477DF3", | |||
selectedColor: "#2a82e4", | |||
list: [ | |||
{ | |||
pagePath: "/pages/FirstPage/index", | |||
@@ -40,14 +40,14 @@ Component({ | |||
const path = dataset.path | |||
const index = dataset.index | |||
const auth = dataset.auth | |||
const openId = wx.getStorageSync('openId') | |||
const openid = wx.getStorageSync('openid') | |||
if(auth) { | |||
if(openId) { | |||
if(openid) { | |||
wx.switchTab({ | |||
url: path | |||
}) | |||
} else { | |||
getUserInfo().then(res=> { | |||
getOpenidData().then(res=> { | |||
wx.switchTab({ | |||
url: path | |||
}) |
@@ -10,7 +10,7 @@ Page({ | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
checkAgree: false, | |||
checkAgree: false, // 是否勾选用户协议 | |||
form: {}, | |||
ossForm: {}, | |||
imagePreviewList: [], // 上传图片预览列表 | |||
@@ -281,17 +281,17 @@ Page({ | |||
}) | |||
}) | |||
Promise.all(temp).then((res)=> { | |||
let form = this.data.form; | |||
let form = this.data.form | |||
form.feedbackUrl = res.join(',') | |||
feedbackPosition(form).then(res => { | |||
if (res.code === 0) { | |||
wx.reLaunch({ | |||
url: '/package_A/pages/submitSuccess/index', | |||
}) | |||
} | |||
}).finally(()=>{ | |||
wx.hideLoading(); | |||
feedbackPosition(form).then(res => { | |||
if (res.code === 0) { | |||
wx.reLaunch({ | |||
url: '/package_A/pages/submitSuccess/index', | |||
}) | |||
} | |||
}).finally(()=>{ | |||
wx.hideLoading(); | |||
}) | |||
}).catch(()=> { |
@@ -2,7 +2,7 @@ | |||
<view class="upload_container"> | |||
<image class="head_img" mode="widthFix" src="../../../assets/img/upload_head.png"></image> | |||
<view class="form_container"> | |||
<view class="form_item"> | |||
<view class="form_item"> | |||
<text><text style="color: red;">*</text>选择河道:</text> | |||
<view class="value_box disable_class"> | |||
<text class="picker_text">{{form.streamName}}</text> | |||
@@ -20,52 +20,49 @@ | |||
<view class="use_purpose {{formRules.feedbackDesc.warning ? 'warning' : ''}}"> | |||
<text><text style="color: red;">*</text>问题描述:</text> | |||
<view class="value_box"> | |||
<textarea maxlength="200" style="width:500rpx; height: 160rpx;padding-top: 10rpx;" type="text" adjust-position="{{true}}" placeholder="请输入问题描述" placeholder-style="font-size: 24rpx; color: #A6A6A6;" value="{{form.feedbackDesc}}" | |||
data-name="feedbackDesc" name="feedbackDesc" bindblur="bindValue" /> | |||
<textarea maxlength="200" style="width:500rpx; height: 160rpx;padding-top: 10rpx;" type="text" adjust-position="{{true}}" placeholder="请输入问题描述" placeholder-style="font-size: 24rpx; color: #A6A6A6;" value="{{form.feedbackDesc}}" data-name="feedbackDesc" name="feedbackDesc" bindblur="bindValue" /> | |||
</view> | |||
<text class="tips">请输入问题描述</text> | |||
</view> | |||
<view class="form_item {{formRules.feedbackName.warning ? 'warning' : ''}}"> | |||
<text><text style="color: red;">*</text>姓名:</text> | |||
<view class="value_box"> | |||
<input style="width: 100%;height: 100%;" type="text" maxlength="100" placeholder="请输入您的姓名" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.feedbackName}}" | |||
data-name="feedbackName" name="feedbackName" bindblur="bindValue" /> | |||
<input style="width: 100%;height: 100%;" type="text" maxlength="100" placeholder="请输入您的姓名" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.feedbackName}}" data-name="feedbackName" name="feedbackName" bindblur="bindValue" /> | |||
</view> | |||
<text class="tips">请输入您的姓名</text> | |||
</view> | |||
<view class="form_item {{formRules.feedbackPhone.warning ? 'warning' : ''}}"> | |||
<text><text style="color: red;">*</text>电话号码:</text> | |||
<view class="value_box"> | |||
<input style="width: 100%;height: 100%;" maxlength="11" type="text" placeholder="请输入您的电话号码" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.feedbackPhone}}" | |||
data-name="feedbackPhone" name="feedbackPhone" bindblur="bindValue" /> | |||
<input style="width: 100%;height: 100%;" maxlength="11" type="text" placeholder="请输入您的电话号码" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.feedbackPhone}}" data-name="feedbackPhone" name="feedbackPhone" bindblur="bindValue" /> | |||
</view> | |||
<text class="tips">请输入正确格式的电话号码</text> | |||
</view> | |||
<view class="upload_images {{formRules.imageList.warning? 'warning': ''}}"> | |||
<text><text style="color: red;">*</text>上传照片:</text> | |||
<view class="image_list"> | |||
<view class="image_preview" wx:for="{{imagePreviewList}}" wx:key="index"> | |||
<image class="image_item" src="{{item}}" mode="aspectFill" data-item="{{item}}"> | |||
</image> | |||
<div class="close" data-current="{{index}}" catchtap="deleteImage"></div> | |||
</view> | |||
<view class="upload_image" bindtap="uploadImage" wx:if="{{imageList.length<5}}"> | |||
<image style="height: 56rpx;width: 56rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image> | |||
</view> | |||
<text><text style="color: red;">*</text>上传照片:</text> | |||
<view class="image_list"> | |||
<view class="image_preview" wx:for="{{imagePreviewList}}" wx:key="index"> | |||
<image class="image_item" src="{{item}}" mode="aspectFill" data-item="{{item}}"> | |||
</image> | |||
<div class="close" data-current="{{index}}" catchtap="deleteImage"></div> | |||
</view> | |||
<view class="upload_image" bindtap="uploadImage" wx:if="{{imageList.length<5}}"> | |||
<image style="height: 56rpx;width: 56rpx;" mode="widthFix" src="../../../assets/img/upload.png"></image> | |||
</view> | |||
<text class="tips">请上传图片</text> | |||
</view> | |||
<text class="tips">请上传图片</text> | |||
</view> | |||
</view> | |||
<view class="safe_box"> | |||
<label class="checkbox" bindtap="checkBoxChange"> | |||
<checkbox value="{{checkAgree}}" /><text>同意</text> | |||
</label> | |||
<text style="color: #477DF3;" bindtap="showAgree">《用户服务协议》</text>和<text style="color: #477DF3;" bindtap="showConceal">《隐私政策》</text> | |||
<text style="color: #2a82e4;" bindtap="showAgree">《用户服务协议》</text>和<text style="color: #2a82e4;" bindtap="showConceal">《隐私政策》</text> | |||
</view> | |||
<view class="btn_list"> | |||
<button class="btn_item cancel_btn" bindtap="returnLastPage">取消</button> | |||
<button disabled="{{!checkAgree}}" class="btn_item submit_btn" bindtap="submit">确认</button> | |||
<button disabled="{{!checkAgree}}" class="btn_item submit_btn" bindtap="submit">确认</button> | |||
</view> | |||
</view> | |||
</view> |
@@ -183,7 +183,7 @@ | |||
} | |||
.submit_btn { | |||
color: #ffffff; | |||
background-color: #477DF3; | |||
background-color: #2a82e4; | |||
} | |||
/* 用户协议确认框 */ | |||
.safe_box { |
@@ -0,0 +1,41 @@ | |||
// package_A/pages/storeDetail/index.js | |||
import {wgs84togcj02} from '../../../utils/util.js' | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
dataSource: { | |||
image: '' | |||
}, | |||
dataList: [ | |||
{label: '店铺名称', value: 'shopsName'}, | |||
{label: '所在区域', value: 'areaName'}, | |||
{label: '地址', value: 'shopsAddress'}, | |||
{label: '联系人', value: 'realname'}, | |||
{label: '联系方式', value: 'mobile'} | |||
] | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
if(options.data) { | |||
let dataSource = this.data.dataSource | |||
dataSource = JSON.parse(options.data) | |||
this.setData({dataSource}) | |||
} | |||
}, | |||
showNavigator(){ | |||
const dataSource = this.data.dataSource | |||
const coordinate = wgs84togcj02([dataSource.longitude,dataSource.latitude]) | |||
wx.openLocation({ | |||
latitude: parseFloat(coordinate[1]), // 纬度,范围为-90~90,负数表示南纬 | |||
longitude: parseFloat(coordinate[0]), // 经度,范围为-180~180,负数表示西经 | |||
scale: 17, // 缩放比例 | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "店铺详情" | |||
} |
@@ -0,0 +1,11 @@ | |||
<!--package_A/pages/storeDetail/index.wxml--> | |||
<view class="detail_container"> | |||
<image class="detail_head" src="{{dataSource.shopsImage}}"></image> | |||
<view class="info_list"> | |||
<view class="info_item" wx:for="{{dataList}}" wx:key="index"> | |||
<text>{{item.label}}:</text> | |||
<text>{{dataSource[item.value]}}</text> | |||
</view> | |||
<view class="btn_box" bindtap="showNavigator">导航</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,45 @@ | |||
/* package_A/pages/storeDetail/index.wxss */ | |||
.detail_container { | |||
width: 100%; | |||
min-height: 100vh; | |||
padding: 22rpx 30rpx; | |||
background-color: #F6F6F6; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.detail_head { | |||
width: 100%; | |||
height: 300rpx; | |||
border-radius: 16rpx; | |||
} | |||
.info_list { | |||
width: 100%; | |||
margin-top: 22rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.info_item { | |||
width: 100%; | |||
padding: 40rpx 0 40rpx 100rpx; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
border-bottom: 2rpx solid #EEEEEe; | |||
font-size: 26rpx; | |||
color: #111111; | |||
} | |||
.btn_box { | |||
width: 200rpx; | |||
height: 60rpx; | |||
margin: 50rpx 0; | |||
text-align: center; | |||
line-height: 60rpx; | |||
background-color: #2D84E4; | |||
border-radius: 30rpx; | |||
font-size: 26rpx; | |||
color: #ffffff; | |||
} |
@@ -0,0 +1,59 @@ | |||
// package_A/pages/stores/index.js | |||
import {wgs84togcj02} from '../../../utils/util.js' | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
// 列表数据筛选条件 | |||
params: { | |||
shopsName: '' | |||
}, | |||
shopsName: '', | |||
list: [], | |||
current: "/index/merchant/page", | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
}, | |||
/* 输入名称搜索 */ | |||
search(e) { | |||
let params = this.data.params | |||
params.shopsName = this.data.shopsName | |||
this.setData({ params }) | |||
}, | |||
/* 更新数据 */ | |||
updateList(e) { | |||
let list = this.data.list.concat(e.detail || []) | |||
this.setData({ list }) | |||
}, | |||
/* 重置数据 */ | |||
resetList() { | |||
this.setData({ list: [] }) | |||
}, | |||
// 详情 | |||
showDetail(e) { | |||
let data = e.currentTarget.dataset.item | |||
wx.navigateTo({ | |||
url: '/package_A/pages/storeDetail/index?data='+JSON.stringify(data), | |||
}) | |||
}, | |||
// 导航 | |||
showNavigate(e){ | |||
const data = e.currentTarget.dataset.detail | |||
let coordinate = wgs84togcj02([data.longitude,data.latitude]) | |||
wx.openLocation({ | |||
latitude: parseFloat(coordinate[1]), // 纬度,范围为-90~90,负数表示南纬 | |||
longitude: parseFloat(coordinate[0]), // 经度,范围为-180~180,负数表示西经 | |||
scale: 17, // 缩放比例 | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,7 @@ | |||
{ | |||
"usingComponents": { | |||
"list": "../../../components/List/index" | |||
}, | |||
"navigationBarTitleText": "积分商城", | |||
"navigationBarBackgroundColor": "#2C83E4" | |||
} |
@@ -0,0 +1,26 @@ | |||
<!--package_A/pages/stores/index.wxml--> | |||
<view class="protecityct_container"> | |||
<view class="protect_head"> | |||
<view class="search_container"> | |||
<image class="search_icon" src="../../../assets/img/search.png"></image> | |||
<input class="task-search" type="text" placeholder="请输入搜索的商户名称" model:value="{{shopsName}}" placeholder-class="placeholder-style" bindconfirm="search" bindblur="search"/> | |||
</view> | |||
</view> | |||
<list id="list" class="shop_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | |||
<view class="shop_item" data-item="{{item}}" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||
<view class="shop_info"> | |||
<image class="shop_img" mode="scaleToFill" src="{{item.shopsImage}}"></image> | |||
<view class="massage_box"> | |||
<text style="width: 100%;font-size: 30rpx;">{{item.shopsName}}</text> | |||
<text style="font-size: 26rpx;margin: 16rpx 0;">{{item.areaName}}</text> | |||
<view class="location_text"> | |||
<image style="width: 20rpx;height: 20rpx;margin-right: 10rpx;" src="../../../assets/img/position.png"></image> | |||
<text class="location_value" style="font-size: 22rpx;">{{item.shopsAddress}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="execute_btn" catchtap="showNavigate" data-current="{{index}}" data-detail="{{item}}">导航</view> | |||
</view> | |||
</list> | |||
</view> |
@@ -0,0 +1,116 @@ | |||
/* package_A/pages/stores/index.wxss */ | |||
.protecityct_container { | |||
width: 100%; | |||
min-height: 100vh; | |||
padding: 30rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
color: #333333; | |||
background: linear-gradient(180deg, #2A82E4 0%, rgba(255,255,255,0) 100%); | |||
} | |||
.protect_head { | |||
width: 100%; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-end; | |||
} | |||
.search_container { | |||
width: 100%; | |||
height: 80rpx; | |||
padding-left: 60rpx; | |||
box-sizing: border-box; | |||
background: #fff; | |||
border-radius: 34rpx; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.search_icon{ | |||
height: 32rpx; | |||
width: 32rpx; | |||
} | |||
.task-search { | |||
height: 80rpx; | |||
flex: 1; | |||
text-align: left; | |||
border-radius: 30rpx; | |||
font-size: 28rpx; | |||
padding: 0 20rpx; | |||
} | |||
.placeholder-style{ | |||
font-family: "PingFangSC-Regular", "PingFang SC"; | |||
font-weight: normal; | |||
color: #a6a6a6; | |||
} | |||
/* 列表样式 */ | |||
.shop_list { | |||
width: 100%; | |||
flex: 1; | |||
margin-top: 30rpx; | |||
background-color: #fff; | |||
border-radius: 16rpx; | |||
} | |||
.shop_item { | |||
width: 100%; | |||
padding: 50rpx 20rpx; | |||
border-bottom: 2rpx solid #eeeeee; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.shop_info { | |||
box-sizing: border-box; | |||
/* width: 100%; */ | |||
width: calc(100% - 100rpx); | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.shop_img { | |||
width: 260rpx; | |||
height: 180rpx; | |||
border-radius: 20rpx; | |||
} | |||
.massage_box { | |||
width: calc(100% - 260rpx); | |||
box-sizing: border-box; | |||
margin-left: 30rpx; | |||
padding-top: 10rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
color: #0C0C0C; | |||
} | |||
.location_text { | |||
width: 100%; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.location_value { | |||
width: 250rpx; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.execute_btn { | |||
width: 90rpx; | |||
height: 56rpx; | |||
margin-left: 10rpx; | |||
margin-top: 20rpx; | |||
font-size: 24rpx; | |||
color: #fff; | |||
line-height: 56rpx; | |||
text-align: center; | |||
background-color: #2D84E4; | |||
border-radius: 28rpx; | |||
} |
@@ -0,0 +1,49 @@ | |||
// package_B/pages/IdList/index.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
list: [], | |||
current: "/identity/index", | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
this.setData({ | |||
current: "/identity/index" | |||
}) | |||
}, | |||
/* 更新数据 */ | |||
updateList(e) { | |||
let list = this.data.list.concat(e.detail || []) | |||
this.setData({ list }) | |||
}, | |||
/* 重置数据 */ | |||
resetList() { | |||
this.setData({ list: [] }) | |||
}, | |||
/* 跳转申请页面 */ | |||
uploadApprove(e) { | |||
let detail = e.currentTarget.dataset.detail | |||
const params = { | |||
applyIdentityId: detail.id, | |||
applyIdentityName: detail.identityName | |||
} | |||
wx.navigateTo({ | |||
url: '/package_B/pages/approveId/index?data=' + JSON.stringify(params), | |||
}) | |||
}, | |||
/* 跳转至详情页 */ | |||
showDetail(e) { | |||
let data = e.currentTarget.dataset.item | |||
// wx.navigateTo({ | |||
// url: '/package_A/pages/riverDetail/index?data='+ JSON.stringify(data), | |||
// }) | |||
} | |||
}) |
@@ -0,0 +1,6 @@ | |||
{ | |||
"usingComponents": { | |||
"list": "../../../components/List/index" | |||
}, | |||
"navigationBarTitleText": "身份列表" | |||
} |
@@ -0,0 +1,17 @@ | |||
<!--package_B/pages/IdList/index.wxml--> | |||
<view class="id_container"> | |||
<list id="list" class="id_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | |||
<view class="id_item" data-item="{{item}}" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||
<image class="id_bg" mode="widthFix" src="../../../assets/img/id_bg.png"> | |||
</image> | |||
<view class="id_info"> | |||
<view class="massage_box"> | |||
<text style="font-size: 30rpx;font-weight: bold;">{{item.identityName}}</text> | |||
<text style="font-size: 22rpx;margin-top: 30rpx;">{{item.identityRemark}}</text> | |||
</view> | |||
<view class="execute_btn" catchtap="uploadApprove" data-current="{{index}}" data-detail="{{item}}">去申请</view> | |||
</view> | |||
</view> | |||
</list> | |||
</view> |
@@ -0,0 +1,60 @@ | |||
/* package_B/pages/IdList/index.wxss */ | |||
.id_container { | |||
width: 100%; | |||
height: 100vh; | |||
padding: 0 30rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
color: #333333; | |||
} | |||
/* 列表样式 */ | |||
.id_list { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.id_item { | |||
width: 100%; | |||
margin-bottom: 30rpx; | |||
position: relative; | |||
} | |||
.id_bg { | |||
width: 100%; | |||
} | |||
.id_info { | |||
width: 100%; | |||
height: 100%; | |||
padding: 50rpx 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
} | |||
.massage_box { | |||
box-sizing: border-box; | |||
max-width: calc(100%-190rpx); | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: space-between; | |||
align-items: flex-start; | |||
color: #fff; | |||
} | |||
.id_img { | |||
display: block; | |||
width: 178rpx; | |||
height: 144rpx; | |||
margin-right: 20rpx; | |||
} | |||
.execute_btn { | |||
width: 180rpx; | |||
height: 80rpx; | |||
font-size: 26rpx; | |||
color: #fff; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background-color: #2A82E4FF; | |||
border-radius: 40rpx; | |||
} |
@@ -0,0 +1,123 @@ | |||
// package_B/pages/approveId/index.js | |||
import {approveIdenty} from '../../../api/mine.js' | |||
import {isPositiveInteger} from '../../../utils/check.js' | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
checkAgree: false, | |||
form: {}, | |||
// 表单验证 | |||
formRules: { | |||
applyName: { | |||
validator: function (value) { | |||
return value; | |||
}, | |||
warning: false | |||
}, | |||
applyPhone: { | |||
validator: function (value) { | |||
return value && isPositiveInteger(value); | |||
}, | |||
warning: false | |||
} | |||
}, | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
if(options.data) { | |||
const params = JSON.parse(options.data) | |||
const applyOpenid = wx.getStorageSync('openid') | |||
this.setData({ | |||
form: { | |||
applyOpenid, | |||
...params | |||
} | |||
}) | |||
} | |||
}, | |||
// 输入框输入 | |||
bindValue(e) { | |||
let name = e.currentTarget.dataset.name; | |||
let form = this.data.form; | |||
form[name] = e.detail.value; | |||
this.setData({ | |||
form, | |||
}) | |||
this.validate(name, e.detail.value) | |||
}, | |||
// 表项验证 | |||
validate(name) { | |||
if(name !== 'applyRemark') { | |||
let formRules = this.data.formRules; | |||
let validator = formRules[name].validator | |||
let result = validator ? !validator(this.data.form[name]) : false; | |||
formRules[name].warning = result | |||
this.setData({formRules}) | |||
return result | |||
} | |||
}, | |||
// 表单验证 | |||
validateForm() { | |||
return new Promise((resolve, reject) => { | |||
try { | |||
let formRules = this.data.formRules; | |||
let result = false; | |||
for (let key in formRules) { | |||
let temp = this.validate(key) | |||
if (temp) { | |||
result = temp | |||
} | |||
} | |||
resolve(!result) | |||
} catch (e) { | |||
reject(e) | |||
} | |||
}) | |||
}, | |||
/** | |||
* 同意用户协议 | |||
*/ | |||
checkBoxChange() { | |||
let checkAgree = this.data.checkAgree | |||
this.setData({ | |||
checkAgree: !checkAgree | |||
}) | |||
}, | |||
// 用户服务协议 | |||
showAgree() { | |||
wx.navigateTo({ | |||
url: '/package_A/pages/agree/index', | |||
}) | |||
}, | |||
// 隐私政策 | |||
showConceal() { | |||
wx.navigateTo({ | |||
url: '/package_A/pages/conceal/index', | |||
}) | |||
}, | |||
// 提交申请 | |||
submit(){ | |||
this.validateForm().then(res => { | |||
if(res) { | |||
wx.showLoading({title:"上传中",mask:true}) | |||
const params = this.data.form | |||
approveIdenty(params).then(res => { | |||
if (res.code === 0) { | |||
wx.reLaunch({ | |||
url: '/package_B/pages/submitSuccess/index', | |||
}) | |||
} | |||
}).finally(()=>{ | |||
wx.hideLoading(); | |||
}) | |||
} | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "身份申请" | |||
} |
@@ -0,0 +1,35 @@ | |||
<!--package_B/pages/approveId/index.wxml--> | |||
<view class="approve_container"> | |||
<text class="approve_title">请提交你的申请信息</text> | |||
<view class="form_container"> | |||
<view class="form_item {{formRules.applyName.warning ? 'warning' : ''}}"> | |||
<text><text style="color: red;">* </text>姓名:</text> | |||
<view class="value_box"> | |||
<input style="width: 100%;height: 100%;" type="text" maxlength="100" placeholder="请输入您的姓名" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.applyName}}" data-name="applyName" name="applyName" bindblur="bindValue" /> | |||
</view> | |||
<text class="tips">请输入您的姓名</text> | |||
</view> | |||
<view class="form_item {{formRules.applyPhone.warning ? 'warning' : ''}}"> | |||
<text><text style="color: red;">* </text>电话:</text> | |||
<view class="value_box"> | |||
<input style="width: 100%;height: 100%;" maxlength="11" type="text" placeholder="请输入您的电话" placeholder-style="font-size: 24rpx; color: #A6A6A6;" adjust-position="{{true}}" value="{{form.applyPhone}}" data-name="applyPhone" name="applyPhone" bindblur="bindValue" /> | |||
</view> | |||
<text class="tips">请输入您的电话</text> | |||
</view> | |||
<view class="use_purpose"> | |||
<text>申请理由:</text> | |||
<textarea maxlength="200" style="width:460rpx; height: 160rpx;" type="text" adjust-position="{{true}}" placeholder="请输入申请理由" placeholder-style="font-size: 24rpx; color: #A6A6A6;" value="{{form.applyRemark}}" data-name="applyRemark" name="applyRemark" bindblur="bindValue" /> | |||
<text class="tips">请输入申请理由</text> | |||
</view> | |||
</view> | |||
<view class="safe_box"> | |||
<label class="checkbox" bindtap="checkBoxChange"> | |||
<checkbox value="{{checkAgree}}" /><text>同意</text> | |||
</label> | |||
<text style="color: #2a82e4;" bindtap="showAgree">《用户服务协议》</text>和<text style="color: #2a82e4;" bindtap="showConceal">《隐私政策》</text> | |||
</view> | |||
<view class="btn_list"> | |||
<button disabled="{{!checkAgree}}" class="btn_item submit_btn" bindtap="submit">确认</button> | |||
<button class="btn_item cancel_btn" bindtap="returnLastPage">取消</button> | |||
</view> | |||
</view> |
@@ -0,0 +1,113 @@ | |||
/* package_B/pages/approveId/index.wxss */ | |||
.approve_container { | |||
width: 100%; | |||
padding: 0 60rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.approve_title { | |||
margin-top: 20rpx; | |||
font-size: 32rpx; | |||
font-weight: bold; | |||
} | |||
.form_container { | |||
width: 100%; | |||
margin-top: 30rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.form_item { | |||
width: 100%; | |||
min-height: 68rpx; | |||
padding: 0 20rpx; | |||
margin-bottom: 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
position: relative; | |||
font-size: 26rpx; | |||
background-color: #F8F8F8; | |||
border-radius: 34rpx; | |||
} | |||
.use_purpose { | |||
width: 100%; | |||
padding: 14rpx 0 14rpx 40rpx; | |||
margin-bottom: 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: flex-start; | |||
position: relative; | |||
font-size: 26rpx; | |||
background-color: #F8F8F8; | |||
border-radius: 34rpx; | |||
} | |||
.value_box { | |||
width: 480rpx; | |||
min-height: 68rpx; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
position: relative; | |||
color: #333333; | |||
font-size: 24rpx; | |||
} | |||
.tips{ | |||
position: absolute; | |||
bottom: -32rpx; | |||
left: -13rpx; | |||
color: red; | |||
font-size: 24rpx; | |||
transform: translate(27rpx, -5rpx); | |||
display: none; | |||
} | |||
.form_item.warning .tips, .use_purpose.warning .tips { | |||
display: block; | |||
} | |||
/* 按钮区 */ | |||
.btn_list { | |||
width: 100%; | |||
margin-top: 20rpx; | |||
padding: 10rpx 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
} | |||
.btn_item { | |||
width: 140rpx !important; | |||
padding: 0 !important; | |||
height: 80rpx; | |||
border-radius: 40rpx; | |||
text-align: center; | |||
line-height: 80rpx; | |||
font-size: 28rpx; | |||
} | |||
.cancel_btn { | |||
color: #ffffff; | |||
background-color: #A4A4A4; | |||
} | |||
.submit_btn { | |||
color: #ffffff; | |||
background-color: #2a82e4; | |||
} | |||
/* 用户协议确认框 */ | |||
.safe_box { | |||
width: 100%; | |||
margin-top: 50rpx; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
font-size: 24rpx; | |||
} | |||
.checkbox { | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
checkbox { | |||
transform: scale(0.7); | |||
} |
@@ -0,0 +1,38 @@ | |||
// package_B/pages/exchange/index.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
list: [], | |||
current: "/my/exchange", | |||
params: {} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
let params = this.data.params | |||
params.openid = wx.getStorageSync('openid') | |||
this.setData({params}) | |||
}, | |||
/* 更新数据 */ | |||
updateList(e) { | |||
let list = this.data.list.concat(e.detail) | |||
this.setData({ list }) | |||
}, | |||
/* 重置数据 */ | |||
resetList() { | |||
this.setData({ list: [] }) | |||
}, | |||
/* 跳转至详情页 */ | |||
showDetail(e) { | |||
let data = e.currentTarget.dataset.item | |||
wx.navigateTo({ | |||
url: '/package_B/pages/feedbackDetail/index?data='+ JSON.stringify(data), | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,6 @@ | |||
{ | |||
"usingComponents": { | |||
"list": "../../../components/List/index" | |||
}, | |||
"navigationBarTitleText": "我的兑换" | |||
} |
@@ -0,0 +1,18 @@ | |||
<!--package_B/pages/exchange/index.wxml--> | |||
<view class="protect_container"> | |||
<list id="list" class="exchange_list" url="{{current}}" bind:update-list="updateList" list="{{list}}" bind:reset-list="resetList" params="{{params}}"> | |||
<view class="exchange_item" data-item="{{item}}" bindtap="showDetail" wx:for="{{list}}" wx:key="index"> | |||
<view class="exchange_info"> | |||
<image class="exchange_img" src="{{item.shopsImage}}"></image> | |||
<view class="info_box"> | |||
<view style="color: #2D84E4;" class="status_box">已兑换</view> | |||
<text class="info_item" style="font-size: 30rpx; font-weight: bold;">{{item.nickname}}</text> | |||
<text class="info_item" style="font-size: 26rpx;margin: 16rpx 0;">{{item.areaName}}</text> | |||
<text class="info_item" style="font-size: 22rpx;">{{item.createTime}}</text> | |||
<view class="status_box">实付:<text style="color: #2D84E4;">{{item.pointsChange}}</text>积分</view> | |||
</view> | |||
</view> | |||
</view> | |||
</list> | |||
</view> |
@@ -0,0 +1,58 @@ | |||
/* package_B/pages/exchange/index.wxss */ | |||
.protect_container { | |||
width: 100%; | |||
height: 100vh; | |||
padding: 0 30rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
color: #0C0C0C; | |||
} | |||
.exchange_list { | |||
width: 100%; | |||
height: 100vh; | |||
} | |||
.exchange_item { | |||
width: 100%; | |||
padding: 30rpx 0; | |||
background-color: #ffffff; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-end; | |||
border-bottom: 2rpx solid #eeeeee; | |||
} | |||
.info_head { | |||
font-size: 22rpx; | |||
} | |||
.exchange_info { | |||
width: 100%; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: flex-start; | |||
} | |||
.exchange_img { | |||
width: 262rpx; | |||
height: 180rpx; | |||
margin-right: 30rpx; | |||
border-radius: 20rpx; | |||
} | |||
.info_box { | |||
width: 395rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.status_box { | |||
width: 100%; | |||
text-align: end; | |||
font-size: 22rpx; | |||
} | |||
.info_item { | |||
width: 100%; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} |
@@ -9,8 +9,8 @@ Page({ | |||
statusList: [ | |||
{title: '待处理', color: '#F34747'}, | |||
{title: '待处理', color: '#F34747'}, | |||
{title: '已处理', color: '#477DF3'}, | |||
{title: '已处理', color: '#477DF3'} | |||
{title: '已处理', color: '#2a82e4'}, | |||
{title: '已处理', color: '#2a82e4'} | |||
] | |||
}, | |||
@@ -0,0 +1,41 @@ | |||
// package_B/pages/myId/index.js | |||
import {getIdApprove} from '../../../api/mine.js' | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
records: {} | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
this.getApproveRecord() | |||
}, | |||
getApproveRecord() { | |||
const openid = wx.getStorageSync('openid') | |||
getIdApprove({openid}).then(res=> { | |||
if(res.code === 0) { | |||
this.setData({ | |||
records: res.data | |||
}) | |||
} | |||
}) | |||
}, | |||
// 重新申请 | |||
reApprove() { | |||
wx.navigateTo({ | |||
url: '/package_B/pages/IdList/index', | |||
}) | |||
}, | |||
// 返回我的页面 | |||
returnList() { | |||
wx.switchTab({ | |||
url: '/pages/mine/index', | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "我的身份" | |||
} |
@@ -0,0 +1,31 @@ | |||
<!--package_B/pages/myId/index.wxml--> | |||
<view class="myid_container"> | |||
<view class="records_box" wx:if="{{records}}"> | |||
<view class="record_title">您当前申请的身份</view> | |||
<view class="record_card"> | |||
<image wx:if="{{records.status === 1}}" class="approve_bg" mode="widthFix" src="../../../assets/img/approveing.png"></image> | |||
<image wx:if="{{records.status === 2}}" class="approve_bg" mode="widthFix" src="../../../assets/img/passed.png"></image> | |||
<image wx:if="{{records.status === 3}}" class="approve_bg" mode="widthFix" src="../../../assets/img/failed.png"></image> | |||
<view class="record_info"> | |||
<view class="massage_box"> | |||
<text style="font-size: 30rpx;font-weight: bold;">{{records.applyIdentityName}}</text> | |||
<text style="font-size: 22rpx;margin-top: 30rpx;">{{records.identityRemark}}</text> | |||
</view> | |||
<view wx:if="{{records.status === 1}}" class="execute_btn" style="background-color: #05E4AF;">申请中</view> | |||
<view wx:if="{{records.status === 2}}" class="execute_btn" style="background-color: #2B83E4;">申请通过</view> | |||
<view wx:if="{{records.status === 3}}" class="execute_btn" style="background-color: #FF2D2D;">申请不通过</view> | |||
</view> | |||
</view> | |||
<view class="btn_units"> | |||
<view wx:if="{{records.status !== 1}}" class="re_approve" bindtap="reApprove">重新申请</view> | |||
</view> | |||
</view> | |||
<view class="empty_box" wx:else> | |||
<image class="success_img" src="../../../assets/img/unapprove.png" mode="widthFix"></image> | |||
<view class="tips_text">您当前还未申请身份, 请返回“我的”页面申请身份!</view> | |||
<view class="return_btn" bindtap="returnList">我知道了</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,118 @@ | |||
/* package_B/pages/myId/index.wxss */ | |||
.myid_container { | |||
width: 100%; | |||
padding: 0 30rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.records_box { | |||
width: 100%; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.record_title { | |||
margin: 60rpx 0; | |||
padding-left: 40rpx; | |||
color: #111111; | |||
font-size: 32rpx; | |||
font-weight: 800; | |||
} | |||
.record_card { | |||
width: 100%; | |||
position: relative; | |||
} | |||
.approve_bg { | |||
width: 100%; | |||
} | |||
.record_info { | |||
width: 100%; | |||
height: 100%; | |||
padding: 50rpx 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
} | |||
.massage_box { | |||
box-sizing: border-box; | |||
max-width: calc(100%-190rpx); | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: space-between; | |||
align-items: flex-start; | |||
color: #fff; | |||
} | |||
.id_img { | |||
display: block; | |||
width: 178rpx; | |||
height: 144rpx; | |||
margin-right: 20rpx; | |||
} | |||
.execute_btn { | |||
width: 180rpx; | |||
height: 80rpx; | |||
font-size: 26rpx; | |||
color: #fff; | |||
line-height: 80rpx; | |||
text-align: center; | |||
background-color: #2A82E4FF; | |||
border-radius: 40rpx; | |||
} | |||
.btn_units { | |||
width: 100%; | |||
margin-top: 380rpx; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
} | |||
.re_approve { | |||
width: 326rpx; | |||
height: 80rpx; | |||
text-align: center; | |||
line-height: 80rpx; | |||
font-size: 26rpx; | |||
font-weight: 800; | |||
color: #fff; | |||
background-color: #4BE2AC; | |||
border-radius: 40rpx; | |||
} | |||
.empty_box { | |||
width: 100%; | |||
padding: 130rpx 170rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.success_img { | |||
width: 224rpx; | |||
height: 224rpx; | |||
margin-bottom: 126rpx; | |||
} | |||
.tips_text { | |||
font-size: 26rpx; | |||
font-weight: 800; | |||
color: #504E4E; | |||
text-indent: 34rpx; | |||
} | |||
.return_btn { | |||
width: 400rpx; | |||
height: 88rpx; | |||
margin-top: 260rpx; | |||
border-radius: 40rpx; | |||
background-color: #4BE2AC; | |||
line-height: 88rpx; | |||
text-align: center; | |||
color: #ffffff; | |||
font-size: 24rpx; | |||
font-weight: bold; | |||
} |
@@ -11,8 +11,8 @@ Page({ | |||
statusList: [ | |||
{title: '待处理', color: '#F34747'}, | |||
{title: '待处理', color: '#F34747'}, | |||
{title: '已处理', color: '#477DF3'}, | |||
{title: '已处理', color: '#477DF3'} | |||
{title: '已处理', color: '#2a82e4'}, | |||
{title: '已处理', color: '#2a82e4'} | |||
] | |||
}, | |||
@@ -25,19 +25,6 @@ Page({ | |||
this.setData({params}) | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/* 更新数据 */ | |||
updateList(e) { | |||
let list = this.data.list.concat(e.detail) |
@@ -0,0 +1,36 @@ | |||
// package_A/pages/sreamDetail/index.js | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady() { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow() { | |||
}, | |||
returnList(){ | |||
wx.switchTab({ | |||
url: '/pages/mine/index' | |||
}) | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "" | |||
} |
@@ -0,0 +1,6 @@ | |||
<!--package_A/pages/sreamDetail/index.wxml--> | |||
<view class="success_container"> | |||
<image class="success_img" src="../../../assets/img/submit_success.png" mode="widthFix"></image> | |||
<view class="tips_text">您的申请已提交,请耐心等待审核!</view> | |||
<view class="return_btn" bindtap="returnList">我知道了</view> | |||
</view> |
@@ -0,0 +1,31 @@ | |||
/* package_A/pages/sreamDetail/index.wxss */ | |||
.success_container { | |||
width: 100%; | |||
padding: 150rpx 125rpx 0 125rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.success_img { | |||
width: 224rpx; | |||
height: 224rpx; | |||
margin-bottom: 126rpx; | |||
} | |||
.tips_text { | |||
font-size: 26rpx; | |||
color: #666666; | |||
} | |||
.return_btn { | |||
width: 400rpx; | |||
height: 88rpx; | |||
margin-top: 260rpx; | |||
border-radius: 40rpx; | |||
background-color: #4BE2AC; | |||
line-height: 88rpx; | |||
text-align: center; | |||
color: #ffffff; | |||
font-size: 24rpx; | |||
font-weight: bold; | |||
} |
@@ -22,7 +22,7 @@ | |||
</view> | |||
<view class="btn_list"> | |||
<view class="btn_item cancel_btn" bindtap="return">返回</view> | |||
<view class="btn_item submit_btn" bindtap="submit">确认</view> | |||
<view class="btn_item submit_btn" bindtap="submit">确定</view> | |||
</view> | |||
</view> |
@@ -1,7 +1,7 @@ | |||
/* package_B/pages/userInfo/index.wxss */ | |||
.form_container { | |||
width: 100%; | |||
padding: 30rpx; | |||
padding: 30rpx 80rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
@@ -14,21 +14,21 @@ | |||
justify-content: space-between; | |||
align-items: center; | |||
position: relative; | |||
font-size: 28rpx; | |||
font-size: 30rpx; | |||
color: #666666; | |||
} | |||
.value_box { | |||
width: 500rpx; | |||
width: 420rpx; | |||
background-color: #F8F8F8; | |||
min-height: 68rpx; | |||
padding: 0 55rpx 0 10rpx; | |||
padding: 0 55rpx 0 20rpx; | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
border: 1rpx solid #A6A6A6; | |||
border-radius: 4rpx; | |||
border-radius: 34rpx; | |||
position: relative; | |||
color: #333333; | |||
font-size: 24rpx; | |||
font-size: 26rpx; | |||
} | |||
.tips{ | |||
position: absolute; | |||
@@ -50,29 +50,30 @@ | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
font-size: 28rpx; | |||
font-size: 30rpx; | |||
color: #666666; | |||
position: relative; | |||
} | |||
.image_preview { | |||
height: 200rpx; | |||
width: 200rpx; | |||
margin-left: 40rpx; | |||
height: 120rpx; | |||
width: 120rpx; | |||
margin-left: 30rpx; | |||
margin-bottom: 20rpx; | |||
position: relative; | |||
} | |||
.image_item { | |||
height:100%; | |||
width: 100%; | |||
margin-bottom: 20rpx; | |||
height:100%; | |||
width: 100%; | |||
border-radius: 16rpx; | |||
margin-bottom: 20rpx; | |||
} | |||
.close{ | |||
position: absolute; | |||
top:0; | |||
right:0; | |||
transform: translate(40%,-40%); | |||
height:50rpx; | |||
width:50rpx; | |||
height:40rpx; | |||
width:40rpx; | |||
background:rgba(179, 179, 179, 0.5); | |||
border-radius: 50%; | |||
z-index: 10; | |||
@@ -104,15 +105,15 @@ | |||
transform: translate(-50%,-50%) rotate(-45deg); | |||
} | |||
.upload_image { | |||
width: 200rpx; | |||
height: 200rpx; | |||
width: 120rpx; | |||
height: 120rpx; | |||
margin-left: 40rpx; | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
justify-content: center; | |||
border: 1rpx solid #A6A6A6; | |||
border-radius: 10rpx; | |||
background-color: #F8F8F8; | |||
border-radius: 34rpx; | |||
} | |||
.upload_image text { | |||
@@ -128,24 +129,25 @@ | |||
.btn_list { | |||
width: 100%; | |||
margin-top: 200rpx; | |||
padding: 10rpx 30rpx; | |||
padding: 10rpx 0; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
} | |||
.btn_item { | |||
width: 280rpx; | |||
width: 240rpx; | |||
height: 80rpx; | |||
border-radius: 40rpx; | |||
text-align: center; | |||
line-height: 80rpx; | |||
font-size: 28rpx; | |||
font-size: 26rpx; | |||
} | |||
.cancel_btn { | |||
color: #333333; | |||
border: 1rpx solid #E6E6E6; | |||
margin-right: 20rpx; | |||
} | |||
.submit_btn { | |||
color: #ffffff; | |||
background-color: #477DF3; | |||
background-color: #2a82e4; | |||
} |
@@ -6,12 +6,10 @@ Page({ | |||
*/ | |||
data: { | |||
list: [], | |||
params: {}, | |||
current: "", | |||
}, | |||
onLoad: function() { | |||
this.setData({ | |||
params, | |||
current: "/index/westreamAct/page" | |||
}) | |||
}, |
@@ -6,8 +6,7 @@ Page({ | |||
*/ | |||
data: { | |||
list: [], | |||
params: {}, | |||
current: "/index/westreamKnow/page", | |||
current: "", | |||
}, | |||
/** | |||
@@ -15,7 +14,6 @@ Page({ | |||
*/ | |||
onLoad(options) { | |||
this.setData({ | |||
params, | |||
current: "/index/westreamKnow/page" | |||
}) | |||
}, |
@@ -9,15 +9,14 @@ Page({ | |||
data: { | |||
// 列表数据筛选条件 | |||
list: [], | |||
params: {}, | |||
current: "/index/westreamScenery/page", | |||
current: "", | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad(options) { | |||
this.setData({ params }) | |||
this.setData({ current: "/index/westreamScenery/page" }) | |||
}, | |||
/** |
@@ -35,9 +35,9 @@ Page({ | |||
type: 'page' | |||
}, | |||
{ | |||
title:'敬请期待', | |||
iconPath: '../../assets/first/more.png', | |||
path: '/package_first/pages/more/index', | |||
title:'积分商城', | |||
iconPath: '../../assets/first/stores.png', | |||
path: '/package_A/pages/stores/index', | |||
type: 'page' | |||
} | |||
], |
@@ -10,22 +10,6 @@ | |||
<image class="banner_image" src="../../assets/first/home_banner.png" mode="aspectFill" bindtap="redirectToAd"></image> | |||
</view> | |||
<!-- 头条 --> | |||
<!-- <view class="announcement " bindtap="showAnnouncementDetail"> | |||
<view class="announcement_img"> | |||
<image src="../../assets/first/inform.png" class="announcement_icon"></image> | |||
<text class="announcement_text">行动</text> | |||
</view> | |||
<swiper class="announcement-swiper" indicator-dots="{{false}}" vertical="false" duration="1000" interval="5000" | |||
autoplay="{{true}}" circular="true"> | |||
<block wx:for="{{announcementList}}" wx:key="index"> | |||
<swiper-item class="announcement-swiper-item" data-current="{{index}}"> | |||
<view class="overflow_ellipsis">{{item.title}}</view> | |||
<view class="inform_date">{{item.createTime}}</view> | |||
</swiper-item> | |||
</block> | |||
</swiper> | |||
</view> --> | |||
<!-- 快捷入口 --> | |||
<view class="fast_enters"> |
@@ -34,8 +34,8 @@ | |||
position: relative; | |||
} | |||
.search_icon{ | |||
height: 60rpx; | |||
width: 60rpx; | |||
height: 34rpx; | |||
width: 34rpx; | |||
position: absolute; | |||
top:50%; | |||
left:51rpx; | |||
@@ -74,7 +74,7 @@ | |||
} | |||
.massage_box { | |||
box-sizing: border-box; | |||
width: calc(100%-150rpx); | |||
width: calc(100% - 150rpx); | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: flex-start; |
@@ -159,14 +159,6 @@ Page({ | |||
tenantCurrent, | |||
tenantId | |||
}) | |||
const tenantObj = { | |||
tenantCurrent, | |||
tenantId | |||
} | |||
wx.setStorage({ | |||
key: 'tenant', | |||
data: tenantObj | |||
}) | |||
this.validate('tenantId') | |||
}, | |||
/** | |||
@@ -295,11 +287,16 @@ Page({ | |||
goHome() { | |||
this.validateForm().then(res => { | |||
if(res) { | |||
const params = {} | |||
params.tenantId = this.data.tenantId | |||
params.openid = this.data.openid | |||
enterMini(params).then(item=> { | |||
enterMini({openid: this.data.openid, tenantId: this.data.tenantId}).then(item=> { | |||
if(item.code === 0) { | |||
const tenantObj = { | |||
tenantCurrent: this.data.tenantCurrent, | |||
tenantId: this.data.tenantId | |||
} | |||
wx.setStorage({ | |||
key: 'tenant', | |||
data: tenantObj | |||
}) | |||
// 进入首页 | |||
const path = this.data.path | |||
const fromType = this.data.fromType |
@@ -118,7 +118,7 @@ | |||
color: #fff; | |||
font-weight: normal; | |||
border-radius: 39rpx; | |||
background-color: #477DF3; | |||
background-color: #2a82e4; | |||
} | |||
.footer { | |||
margin-top: 100rpx; |
@@ -1,4 +1,5 @@ | |||
// pages/mine/index.js | |||
import {getUserData} from '../../api/login.js' | |||
Page({ | |||
/** | |||
@@ -7,9 +8,14 @@ Page({ | |||
data: { | |||
userInfo: {}, // 用户授权信息 | |||
list: [ | |||
{title: '我的反馈', type: 'feedback'}, | |||
{title: '我的美拍', type: 'upload'} | |||
] | |||
{title: '个人信息', type: 'userinfo', path: '/package_B/pages/userInfo/index'}, | |||
{title: '我的反馈', type: 'feedback', path: '/package_B/pages/records/index'}, | |||
{title: '我的美拍', type: 'beauty', path: '/package_B/pages/beauties/index'}, | |||
{title: '我的兑换', type: 'exchange', path: '/package_B/pages/exchange/index'}, | |||
{title: '我的身份', type: 'myid', path: '/package_B/pages/myId/index'} | |||
], | |||
myId: '', // 身份 | |||
integral: 0, // 积分 | |||
}, | |||
/** | |||
@@ -19,28 +25,36 @@ Page({ | |||
this.getTabBar().setData({ | |||
selected: 2 | |||
}) | |||
this.setData({ | |||
userInfo: wx.getStorageSync('userInfo') | |||
}) | |||
}, | |||
onShow:function() { | |||
this.getUserInfo() | |||
}, | |||
goRecords(e) { | |||
const type = e.currentTarget.dataset.type | |||
if(type === 'feedback') { | |||
wx.navigateTo({ | |||
url: '/package_B/pages/records/index', | |||
}) | |||
} else { | |||
wx.navigateTo({ | |||
url: '/package_B/pages/beauties/index', | |||
const path = e.currentTarget.dataset.path | |||
wx.navigateTo({ | |||
url: path, | |||
}) | |||
}, | |||
// 获取 | |||
getUserInfo() { | |||
const params = {} | |||
params.tenantId = wx.getStorageSync('tenant').tenantId | |||
params.openid = wx.getStorageSync('openid') | |||
getUserData(params).then(success=> { | |||
const userInfo = success.data | |||
wx.setStorage({ | |||
key: 'userInfo', | |||
data:userInfo | |||
}) | |||
} | |||
this.setData({userInfo}) | |||
}) | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
// 进入申请身份页面 | |||
goApprove() { | |||
wx.navigateTo({ | |||
url: '/package_B/pages/IdList/index', | |||
}) | |||
} | |||
}) |
@@ -1,4 +1,5 @@ | |||
{ | |||
"usingComponents": {}, | |||
"navigationBarTitleText": "我的" | |||
"navigationBarTitleText": "我的", | |||
"navigationBarBackgroundColor": "#2C83E4" | |||
} |
@@ -1,16 +1,29 @@ | |||
<!--pages/mine/index.wxml--> | |||
<view class="mine_container"> | |||
<view class="user_massage"> | |||
<image class="user_avatar" src="{{userInfo.headimgurl}}"></image> | |||
<text class="user_name">{{userInfo.nickname}}</text> | |||
<view class="message_box"> | |||
<image class="user_avatar" src="{{userInfo.headimgurl}}"></image> | |||
<view class="id_box"> | |||
<text class="user_name">{{userInfo.nickname}}</text> | |||
<view class="integral"> | |||
<text style="color: #ffffff;font-size: 20rpx;">护河积分</text> | |||
<text style="font-size: 40rpx;color: #FFC65E;">{{userInfo.mallPoints || 0}}</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="approve_box"> | |||
<view wx:if="{{userInfo.identityName}}" class="approve_btn">{{userInfo.identityName}}</view> | |||
<view wx:else class="approve_btn" bindtap="goApprove">申请护河身份</view> | |||
<text style="color: #ffffff;font-size: 20rpx;">护河积分可兑换礼物!快来加入我们吧</text> | |||
</view> | |||
</view> | |||
<view class="function_list"> | |||
<view class="function_item" wx:for="{{list}}" wx:key="index" bindtap="goRecords" data-type="{{item.type}}"> | |||
<view class="function_item" wx:for="{{list}}" wx:key="index" bindtap="goRecords" data-path="{{item.path}}"> | |||
<view class="item_title"> | |||
<image style="height: 40rpx;width: 40rpx;margin-right: 15rpx;" src="../../assets/img/record.png"></image> | |||
<image style="height: 60rpx;width: 60rpx;margin-right: 20rpx;" src="{{'../../assets/img/'+ item.type +'.png'}}"></image> | |||
<text style="font-size: 26rpx;">{{item.title}}</text> | |||
</view> | |||
<image style="height: 48rpx;width: 48rpx;" src="../../assets/img/more.png"></image> | |||
<image style="height: 30rpx;width: 30rpx;" src="../../assets/img/more.png"></image> | |||
</view> | |||
</view> |
@@ -2,7 +2,8 @@ | |||
.mine_container { | |||
width: 100%; | |||
height: 100vh; | |||
background-color: #F3F4F5; | |||
padding: 0 30rpx; | |||
background: linear-gradient(180deg, #2A82E4 0%, rgba(255,255,255,0) 100%); | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
@@ -10,35 +11,76 @@ | |||
} | |||
.user_massage { | |||
width: 100%; | |||
height: 200rpx; | |||
padding: 36rpx 60rpx; | |||
background-color: #ffffff; | |||
padding: 60rpx 40rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: flex-start; | |||
} | |||
.message_box { | |||
display: flex; | |||
justify-content: flex-start; | |||
align-items: center; | |||
align-items: flex-start; | |||
} | |||
.user_avatar { | |||
width: 128rpx; | |||
height: 128rpx; | |||
border-radius: 50%; | |||
width: 100rpx; | |||
height: 100rpx; | |||
border-radius: 16rpx; | |||
margin-right: 30rpx; | |||
} | |||
.id_box { | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.user_name { | |||
font-size: 30rpx; | |||
color: #ffffff; | |||
font-weight: bold; | |||
} | |||
.approve_box { | |||
margin-left: 20rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.approve_btn { | |||
width: 250rpx; | |||
height: 80rpx; | |||
margin-bottom: 20rpx; | |||
text-align: center; | |||
line-height: 80rpx; | |||
font-size: 24rpx; | |||
color: #ffffff; | |||
background-color: #2A82E4; | |||
border-radius: 40rpx; | |||
} | |||
.integral { | |||
margin-top: 20rpx; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: flex-start; | |||
} | |||
.function_list { | |||
width: 100%; | |||
margin-top: 30rpx; | |||
flex: 1; | |||
border-radius: 16rpx; | |||
background-color: #ffffff; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: flex-start; | |||
align-items: center; | |||
} | |||
.function_item { | |||
background-color: #ffffff; | |||
width: 100%; | |||
margin-bottom: 20rpx; | |||
padding: 20rpx 30rpx; | |||
padding: 40rpx 60rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
align-items: center; | |||
border-bottom: 2rpx solid #eeeeee; | |||
} | |||
.item_title { | |||
display: flex; |
@@ -98,6 +98,55 @@ | |||
"query": "data=%7B%22id%22%3A148%2C%22code%22%3A%22jr01%22%2C%22name%22%3A%22%E5%8F%A5%E5%AE%B9%E6%B2%B3%22%2C%22provinceCode%22%3A%22320000%22%2C%22cityCode%22%3A%22320100%22%2C%22districtCode%22%3A%22320115%22%2C%22streetCode%22%3A%22jiedao02%22%2C%22villageCode%22%3Anull%2C%22streamAdminId%22%3A163%2C%22streamAdminName%22%3A%22jnhhz01111%22%2C%22longitude%22%3A%22118.12231%22%2C%22latitude%22%3A%2231.32435%22%2C%22location%22%3A%22%E6%96%B9%E5%B1%B1%E7%A7%A6%E6%B7%AE%E6%B2%B3%E5%A4%A7%E4%B9%94%22%2C%22length%22%3A%22190%22%2C%22note%22%3A%22%E5%8F%A5%E5%AE%B9%E6%B2%B3%E8%B5%B7%E6%BA%90%E4%BA%8E%E5%8F%A5%E5%AE%B9%E5%B8%82%EF%BC%8C%E7%BB%88%E7%82%B9%E5%9C%A8%E5%8D%97%E4%BA%AC%E6%B1%9F%E5%AE%81%E5%8C%BA%E6%B1%87%E5%85%A5%E7%A7%A6%E6%B7%AE%E6%B2%B3%22%2C%22status%22%3A1%2C%22createUserName%22%3A%22bguanli02%22%2C%22updateUserName%22%3Anull%2C%22cityArea%22%3A%22%E6%B1%9F%E8%8B%8F%E7%9C%81%E5%8D%97%E4%BA%AC%E5%B8%82%E6%B1%9F%E5%AE%81%E5%8C%BA%E7%A6%84%E5%8F%A3%E8%A1%97%E9%81%93%22%2C%22provinceName%22%3A%22%E6%B1%9F%E8%8B%8F%E7%9C%81%22%2C%22cityName%22%3A%22%E5%8D%97%E4%BA%AC%E5%B8%82%22%2C%22districtName%22%3A%22%E6%B1%9F%E5%AE%81%E5%8C%BA%22%2C%22streetName%22%3A%22%E7%A6%84%E5%8F%A3%E8%A1%97%E9%81%93%22%2C%22villageName%22%3Anull%2C%22createUser%22%3A0%2C%22createTime%22%3A%222023-03-28%2015%3A24%3A59%22%2C%22updateUser%22%3A0%2C%22updateTime%22%3Anull%2C%22mark%22%3A1%2C%22image%22%3A%22https%3A%2F%2Fimage.t-aaron.com%2Fimagedir%2Fwmofkgnxntl_1679988298250.webp%22%2C%22streamGisNumber%22%3Anull%2C%22mobile%22%3Anull%7D", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "个人信息", | |||
"pathName": "package_B/pages/userInfo/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "身份申请", | |||
"pathName": "package_B/pages/approveId/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "身份列表", | |||
"pathName": "package_B/pages/IdList/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "我的身份", | |||
"pathName": "package_B/pages/myId/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "积分商城", | |||
"pathName": "package_A/pages/stores/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "店铺详情", | |||
"pathName": "package_A/pages/storeDetail/index", | |||
"query": "data=%7B%22id%22%3A88%2C%22code%22%3A%2281%22%2C%22name%22%3A%22%E4%BA%94%E5%9F%8E%E5%9C%A9%E4%B8%AD%E5%BF%83%E6%B2%9F%22%2C%22provinceCode%22%3A%22320000%22%2C%22cityCode%22%3A%22320100%22%2C%22districtCode%22%3A%22320115%22%2C%22streetCode%22%3A%22320115004000%22%2C%22villageCode%22%3Anull%2C%22streamAdminId%22%3A30%2C%22streamAdminName%22%3A%22%E8%A1%97%E9%81%93%E6%B2%B3%E6%B9%96%E9%95%BF%22%2C%22longitude%22%3A%22119.076515%22%2C%22latitude%22%3A%2231.926426%22%2C%22location%22%3A%22%E6%B1%9F%E5%AE%81%E5%8C%BA%E6%B7%B3%E5%8C%96%E8%A1%97%E9%81%93%E5%90%B4%E9%9F%B5%E8%B7%AF%22%2C%22length%22%3A%221.1%22%2C%22note%22%3Anull%2C%22status%22%3A1%2C%22createUserName%22%3A%22admin%22%2C%22updateUserName%22%3A%22admin%22%2C%22cityArea%22%3A%22%E6%B1%9F%E8%8B%8F%E7%9C%81%E5%8D%97%E4%BA%AC%E5%B8%82%E6%B1%9F%E5%AE%81%E5%8C%BA%E6%B7%B3%E5%8C%96%E8%A1%97%E9%81%93%22%2C%22provinceName%22%3A%22%E6%B1%9F%E8%8B%8F%E7%9C%81%22%2C%22cityName%22%3A%22%E5%8D%97%E4%BA%AC%E5%B8%82%22%2C%22districtName%22%3A%22%E6%B1%9F%E5%AE%81%E5%8C%BA%22%2C%22streetName%22%3A%22%E6%B7%B3%E5%8C%96%E8%A1%97%E9%81%93%22%2C%22villageName%22%3Anull%2C%22createUser%22%3A0%2C%22createTime%22%3A%222022-07-18%2013%3A44%3A19%22%2C%22updateUser%22%3A0%2C%22updateTime%22%3A%222022-11-07%2013%3A41%3A06%22%2C%22mark%22%3A1%2C%22image%22%3A%22https%3A%2F%2Fimage.t-aaron.com%2Fimagedir%2Fg6cqtgjby2m_1658123057918.jpg%22%2C%22streamGisNumber%22%3Anull%2C%22mobile%22%3Anull%7D", | |||
"launchMode": "default", | |||
"scene": null | |||
}, | |||
{ | |||
"name": "我的兑换", | |||
"pathName": "package_B/pages/exchange/index", | |||
"query": "", | |||
"launchMode": "default", | |||
"scene": null | |||
} | |||
] | |||
} |
@@ -1,25 +1,27 @@ | |||
import baseurl from '../environment.js' | |||
const {proviceCode, cityCode, distractCode} = wx.getStorageSync('positionParams') | |||
const {tenantId} = wx.getStorageSync('tenant') | |||
export const request = function(data) { | |||
export const request = function(params) { | |||
return new Promise((resolve, reject) => { | |||
if(data.showLoading) { | |||
if(params.showLoading) { | |||
wx.showLoading({ | |||
title: '加载中', | |||
mask: true | |||
}) | |||
} | |||
// 接口api拼接环境地址 | |||
data.url = baseurl + data.url | |||
if(tenantId) { | |||
data.data.tenantId = tenantId | |||
params.url = baseurl + params.url | |||
const {tenantId} = wx.getStorageSync('tenant') | |||
if(tenantId && !params?.data?.tenantId) { | |||
params.data = { | |||
...params.data, | |||
tenantId | |||
} | |||
} | |||
wx.request({ | |||
...data, | |||
...params, | |||
success: function(res) { | |||
// 处理请求 | |||
if(data.url === baseurl+'/aliyunOss/getSecurityToken') { | |||
if(params.url === baseurl+'/aliyunOss/getSecurityToken') { | |||
resolve(res.data) | |||
} else { | |||
if(res.data.code == 0) { // 请求成功状态码 | |||
@@ -33,15 +35,15 @@ export const request = function(data) { | |||
reject(error) | |||
}, | |||
complete: function () { | |||
if (data.showLoading) { | |||
if (params.showLoading) { | |||
wx.hideLoading() | |||
} | |||
} | |||
}) | |||
}).catch(()=> { | |||
}).catch(e => { | |||
wx.showToast({ | |||
icon: "error", | |||
title: '系统错误', | |||
title: e || '系统错误', | |||
}) | |||
}) | |||
} |