Commit 16a76289 by 严立

流程测试

parent 881999b9
......@@ -193,63 +193,6 @@ App({
},
/**
* 请求封装
* @function
* @param {object} - 请求参数
* @returns
*/
wxRequest: function (obj) {
var token = wx.getStorageSync('token')
var param = obj.data ? JSON.stringify(obj.data) : ''
var header = obj.header ? obj.header : { 'token': token || '' }
wx.request({
url: this.globalData.baseUrl + obj.url,
data: param,
method: obj.method || 'POST',
header: header,
success: (res) => {
let code = res.data.code * 1
if (200 == code && true == res.data.success) {
if (obj.success) {
obj.success(res.data)
}
} else if (402 == code) {
// this.refreshToken(obj)
} else if (500 === code) {
if (obj.success) {
obj.success(res)
}
} else {
if (obj.fail) {
let err = {
statusCode: code,
msg: res.data.msg || '网络异常'
};
obj.fail(err)
}
}
},
fail: (err) => {
if (obj.fail) {
let err = {
statusCode: 9999,
msg: '网络异常'
};
obj.fail(err)
} else {
wx.showToast({
title: '网络异常',
icon: 'none',
duration: 2000
})
}
}
});
},
/**
* 查询用户认证状态
* 仅在用户已经注册的前提下会查询此函数
* @function
......
......@@ -64,15 +64,15 @@
/* 操作按钮 */
.dialog-operation {
border: 1px #E2E7EF solid;
border-style: solid none none none;
border-width: 1px;
}
.dialog-operation-line {
width: 1px;
height: 32rpx;
border: 1px #E2E7EF solid;
border-style: none solid none solid;
border-width: 1px;
}
.dialog-operation-cancel {
......
......@@ -24,6 +24,9 @@ function showToast (funcOption) {
funcOption = Object.assign(App.ui.toast.data, funcOption)
funcOption.winToast = true
console.log('App.ui.toast', App.ui.toast)
console.log('funcOption', funcOption)
App.ui.toast.setData(funcOption)
// 设置 toast 关闭时间
......
<view class="m-input">
<view class="row ac" hidden="{{!winText}}" bindtap="setInputShow">
<view class="m-input-boundary row ac {{className}}">
<text class="m-input-text-content" hidden="{{value === '' ? true : false}}">{{value}}</text>
<text class="m-input-text-placeholder" hidden="{{value === '' ? false : true}}">{{placeholder}}</text>
<text class="m-input-text-content fs30" hidden="{{value === '' ? true : false}}">{{value}}</text>
<text class="m-input-text-placeholder fs30" hidden="{{value === '' ? false : true}}">{{placeholder}}</text>
</view>
</view>
<view class="row ac" hidden="{{!winInput}}">
<view class="m-input-boundary row ac {{className}}">
<input
class="m-input-input-content row ac"
class="m-input-input-content row ac fs30"
value="{{value}}"
type="{{type}}"
maxlength="{{maxlength}}"
......
......@@ -2,7 +2,13 @@
.m-input-boundary {
position: relative;
width: 100%;
height: 80rpx;
margin: 16rpx 0 0 0;
padding: 0 24rpx;
border-radius: 4px;
overflow-x: scroll;
border: 1px #DBDFE5 solid;
}
/* 显示文本样式 */
......
......@@ -149,13 +149,14 @@ Page({
} else {
funcBanner[funcIndex] = ''
}
this.setData({
This.setData({
banner: funcBanner
})
})
}
// 0 首页,1 所有服务,2 儿童营地,3 海错图,4 元养水韵,5 儿童营地接待,6 拾光花坊, 7 商品
let This = this
let funcShopList = [2, 3, 4, 5, 6]
for (let i = 0, l = funcShopList.length; i < l; i++) {
shopCover(funcShopList[i], i)
......
......@@ -5,7 +5,7 @@
<text>{{notice.title}}</text>
</view>
<view class="date row cs">
<text>{{notice.date}}</text>
<text class="fs26 c31">{{notice.date}}</text>
</view>
<view class="describe">
<rich-text nodes="{{notice.describe}}"></rich-text>
......
.title {
width: 670rpx;
margin-top: 60rpx;
margin: 50rpx 0 0 0;
font-size: 46rpx;
font-weight: bolder;
color: #15191F;
......@@ -8,9 +8,7 @@
.date {
width: 670rpx;
margin: 32rpx 0 64rpx 0;
font-size: 32rpx;
color: #959DA9;
margin: 38rpx 0 64rpx 0;
}
.cover,
......@@ -22,7 +20,7 @@
.describe {
width: 670rpx;
margin-top: 50rpx;
margin: 2rpx 0 0 0;
margin-bottom: 50rpx;
font-size: 30rpx;
font-weight: 300;
......
<m-nav titleText="最新动态"></m-nav>
<m-nav titleText="最新动态" styleIndex="{{1}}"></m-nav>
<view class="container">
<view class="title row cb ae">
......@@ -14,7 +14,7 @@
<text>{{item.date}}</text>
</view>
<view class="notice-describe">
<rich-text nodes="{{item.describe}}"></rich-text>
<text class="fs26 c31">{{item.describe}}</text>
</view>
<view class="notice-cover" wx:if="{{item.cover !== ''}}">
<image src="{{item.cover}}" mode="widthFix"></image>
......
......@@ -36,7 +36,7 @@
.notice-describe {
width: 670rpx;
margin-top: 24rpx;
margin: 16rpx 0 0 0;
}
.notice-describe text {
......
const App = getApp()
let logicData = {
pageScrollLock: false,
pageScrollTimer: 0,
}
let App = getApp()
Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
navScroll: 0,
appointmentDate: '',
appointmentEndDate: '',
appointmentComplete: false,
......@@ -229,7 +218,6 @@ Page({
App.ui.showToast({
iconType: 'loading',
title: '提交中',
duration: 60000,
})
App.request({
url: 'v1/subscribe/doSubscribe',
......@@ -245,9 +233,8 @@ Page({
if (response.data && response.data.code == 500) {
App.ui.showToast({
iconType: 'error',
title: response.data.msg,
title: response.data.message,
})
} else {
this.setData({
appointmentComplete: true,
......@@ -256,9 +243,10 @@ Page({
}
})
.catch((response) => {
console.log('response', response)
App.ui.showToast({
iconType: 'error',
title: response.msg,
title: response.message,
})
})
},
......
......@@ -55,7 +55,7 @@
/* 表单 */
.form-title {
width: 750rpx;
margin-top: 40rpx;
margin: 40rpx 0 10rpx 0;
padding: 0 40rpx;
font-size: 30rpx;
color: #959DA9;
......@@ -85,6 +85,7 @@
width: 76rpx;
height: 40rpx;
border-right: 1px #DBDFE5 solid;
border-radius: 0;
background: #FFFFFF;
}
......@@ -99,6 +100,7 @@
width: 76rpx;
height: 40rpx;
border-left: 1px #DBDFE5 solid;
border-radius: 0;
background: #FFFFFF;
}
......@@ -159,7 +161,7 @@
/* 操作按钮 */
.appointment-operation {
width: 750rpx;
margin-top: 30rpx;
margin: 18rpx 0 0 0;
padding: 30rpx 40rpx;
background: #ffffff;
}
......
......@@ -3,7 +3,7 @@
<view class="container">
<view class="header">
<image class="banner" src="http://upload.miaomiao-bao.com/968f6202008192116574683.jpg"></image>
<image class="banner" src="{{resourcesBase + 'bgi/bgi-71.png'}}"></image>
<view style="display:flex;justify-content: center;padding-top:144rpx;">
<image class="yztq" src="./image/yztq.png"></image>
</view>
......
......@@ -83,80 +83,80 @@ Page({
*/
queryOrder: function () {
// 数据全部加载完成不再执行
App.wxRequest({
App.request({
url: 'v1/order/getOrderList',
data: {
params: {
'goodType': this.data.orderTypeActive ? this.data.orderType[this.data.orderTypeActive].value : '',
'status': this.data.tabItem[this.data.statusActive].value,
'pageSize': 10,
'pageNo': this.data.orderPages,
},
success: (response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].orderId,
'shopId': '',
'shopAppId': '',
'shopName': funcResponse[i].officeName,
'shopLogo': '',
'total': 0,
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'commodityBackup': [],
'commoditySlice3': [],
'commodityType': Number(funcResponse[i].goodType),
'wxRequest': funcResponse[i].wxRequest,
'total': funcResponse[i].smOrderDetails.length
}
})
.then((response) => {
let funcResponse = response.data
let funcList = []
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'id': funcResponse[i].orderId,
'shopId': '',
'shopAppId': '',
'shopName': funcResponse[i].officeName,
'shopLogo': '',
'total': 0,
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'commodityBackup': [],
'commoditySlice3': [],
'commodityType': Number(funcResponse[i].goodType),
'wxRequest': funcResponse[i].wxRequest,
'total': funcResponse[i].smOrderDetails.length
}
}
// 添加订单商品列表
let funcTotal = 0
let funcCommodity = funcResponse[i].smOrderDetails
let commodityBackup = []
for (let ii = 0, ll = funcCommodity.length; ii < ll; ii++) {
let funcCommodityItem = {
'cover': funcCommodity[ii].imgUrl ? funcCommodity[ii].imgUrl : this.data.resourcesBase + 'commodity/menu/commodity-item.png',
'name': funcCommodity[ii].name,
'quantity': funcCommodity[ii].number,
'price': funcCommodity[ii].unitPrice,
}
funcTotal = funcTotal + funcCommodityItem.quantity
funcItem.commodity.push(funcCommodityItem)
funcItem.commodityBackup.push(funcCommodityItem)
}
// 处理大于三条数据的问题
if (funcItem.commodity.length > 3) {
funcItem.commoditySlice3 = funcItem.commodityBackup.slice(0, 3)
// 添加订单商品列表
let funcTotal = 0
let funcCommodity = funcResponse[i].smOrderDetails
let commodityBackup = []
for (let ii = 0, ll = funcCommodity.length; ii < ll; ii++) {
let funcCommodityItem = {
'cover': funcCommodity[ii].imgUrl ? funcCommodity[ii].imgUrl : this.data.resourcesBase + 'commodity/menu/commodity-item.png',
'name': funcCommodity[ii].name,
'quantity': funcCommodity[ii].number,
'price': funcCommodity[ii].unitPrice,
}
funcTotal = funcTotal + funcCommodityItem.quantity
funcItem.commodity.push(funcCommodityItem)
funcItem.commodityBackup.push(funcCommodityItem)
}
// 处理大于三条数据的问题
if (funcItem.commodity.length > 3) {
funcItem.commoditySlice3 = funcItem.commodityBackup.slice(0, 3)
}
funcItem.total = funcTotal
// 映射门店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcItem.shopName.toLowerCase() === App.globalData.shopId[i].name.toLowerCase()) {
funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
} else if (funcItem.shopName.toLowerCase().indexOf(App.globalData.shopId[i].name.toLowerCase()) != -1) {
// 5D星空影院
funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
}
funcItem.total = funcTotal
// 映射门店信息
for (let i = 0, l = App.globalData.shopId.length; i < l; i++) {
if (funcItem.shopName.toLowerCase() === App.globalData.shopId[i].name.toLowerCase()) {
funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
} else if (funcItem.shopName.toLowerCase().indexOf(App.globalData.shopId[i].name.toLowerCase()) != -1) {
// 5D星空影院
funcItem.shopId = App.globalData.shopId[i].id
funcItem.shopAppId = App.globalData.shopId[i].appId
funcItem.shopLogo = App.globalData.shopId[i].logo
break
}
funcList.push(funcItem)
}
this.setData({
orderList: this.data.orderPages === 1 ? funcList : this.data.orderList.concat(funcList)
})
funcList.push(funcItem)
}
this.setData({
orderList: this.data.orderPages === 1 ? funcList : this.data.orderList.concat(funcList)
})
})
},
......@@ -167,65 +167,65 @@ Page({
* @returns
*/
setOrderType: function () {
App.wxRequest({
App.request({
url: 'v1/common/getDictByType',
data: {
params: {
'type': 'order_good_type',
},
success: (response) => {
let funcResponse = response.data
let funcList = [{
'value': '',
'name': '全部分类'
}]
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem ={
'value': funcResponse[i].value,
}
if(funcResponse[i].value==3 ){
//门票
funcItem.name = "门票"
funcList.push(funcItem)
} else if( funcResponse[i].value==5 ){
// 餐饮
funcItem.name = "餐饮"
funcList.push(funcItem)
}else if( funcResponse[i].value==-2 ){
// 影票
funcItem.name = "影票"
funcList.push(funcItem)
}else if( funcResponse[i].value==2 ){
// SPA
funcItem.name = "SPA"
funcList.push(funcItem)
}else if( funcResponse[i].value==4 ){
// 文创
funcItem.name = "文创"
funcList.push(funcItem)
}
})
.then((response) => {
let funcResponse = response.data
let funcList = [{
'value': '',
'name': '全部分类'
}]
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem ={
'value': funcResponse[i].value,
}
let typeTitle = '全部分类' //
let orderTypeActive = 0 //
let aVal = ''
funcList.forEach((item, index) => {
if (item.value == this.data.optionsGoodType) {
typeTitle = item.name
orderTypeActive = index
}
})
if(funcResponse[i].value==3 ){
//门票
funcItem.name = "门票"
funcList.push(funcItem)
} else if( funcResponse[i].value==5 ){
// 餐饮
funcItem.name = "餐饮"
funcList.push(funcItem)
}else if( funcResponse[i].value==-2 ){
// 影票
funcItem.name = "影票"
funcList.push(funcItem)
}else if( funcResponse[i].value==2 ){
// SPA
funcItem.name = "SPA"
funcList.push(funcItem)
}else if( funcResponse[i].value==4 ){
// 文创
funcItem.name = "文创"
funcList.push(funcItem)
}
}
let typeTitle = '全部分类' //
let orderTypeActive = 0 //
let aVal = ''
funcList.forEach((item, index) => {
if (item.value == this.data.optionsGoodType) {
typeTitle = item.name
orderTypeActive = index
}
})
// if (filter.length > 0) {
// typeTitle = filter[0].name
// orderTypeActive = 0
// }
// if (filter.length > 0) {
// typeTitle = filter[0].name
// orderTypeActive = 0
// }
this.setData({
'orderType': funcList,
'orderTypeTitle': typeTitle,
orderTypeActive
})
this.queryOrder()
}
this.setData({
'orderType': funcList,
'orderTypeTitle': typeTitle,
orderTypeActive
})
this.queryOrder()
})
},
......@@ -308,9 +308,7 @@ Page({
* @param
* @returns
*/
onOrderCancel: function (event) {
console.log('onOrderCancel')
onOrderCancel: function (event) {
App.ui.showDialog({
type: 'confirm',
title: '是否确认取消订单',
......@@ -327,24 +325,24 @@ Page({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
App.request({
url: 'v1/order/cancelOrder',
data: {
params: {
'orderId': funcItem.id,
'type': 0,
},
success: (response) => {
App.ui.showToast({
'iconType': 'success',
'title': '取消成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}
})
.then((response) => {
App.ui.showToast({
'iconType': 'success',
'title': '取消成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
})
},
fail: () => { },
......@@ -374,24 +372,24 @@ Page({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
App.request({
url: 'v1/order/cancelOrder',
data: {
params: {
'orderId': funcItem.id,
'type': 1,
},
success: (response) => {
App.ui.showToast({
'iconType': 'success',
'title': '删除成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
}
})
.then((response) => {
App.ui.showToast({
'iconType': 'success',
'title': '删除成功'
})
this.setData({
'isDoing': false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
})
},
fail: () => {},
......
......@@ -80,6 +80,7 @@ Page({
let funcData = response.data
let funcList = [{ text: '全部', value: 0 }]
for (let i = 0, l = funcData.length; i < l; i++) {
if (['101'].includes(funcData[i].tagId)) continue
let funcItem = {
'text': funcData[i].name,
'value': funcData[i].tagId,
......
<m-nav titleText="主题活动" scrollHeight="{{navScroll}}" styleIndex="{{1}}" bindnavChangeHeight="eventNavChangeHeight"></m-nav>
<m-tab item="{{tabItem}}" isFixed="{{true}}" fixedTop="{{tabTop}}" bindtabChange="eventTabChange"></m-tab>
<m-tab class="tab-type" item="{{tabItem}}" isFixed="{{true}}" fixedTop="{{tabTop}}" bindtabChange="eventTabChange"></m-tab>
<view class="container bg-gradient">
<!-- 近期活动 -->
......@@ -12,7 +12,7 @@
</view>
<view class="item-info column">
<view class="item-title row cb ac">
<text>{{item.name}}</text>
<text class="fs30 fw800 c01">{{item.name}}</text>
<text wx:if="{{item.tagNames[0]}}">{{item.tagNames[0]}}</text>
</view>
<view class="item-date row ac">
......
.tab {
position: fixed;
top: 0;
left: 0;
background: #FFFFFF;
.tab-type {
margin: 44rpx 0 0 0;
}
.container {
......@@ -86,14 +83,10 @@
.item-title {
height: 44rpx;
margin-top: 32rpx;
margin: 20rpx 0 0 0;
}
.item-title text:nth-child(1) {
font-size: 34rpx;
font-weight: bold;
color: #15191f;
line-height: 44rpx;
display: -webkit-box;
overflow: hidden;
white-space: normal;
......
......@@ -11,6 +11,7 @@ page {
.status {
z-index: 2;
width: 750rpx;
margin: 52rpx 0 0 0;
background-color: #1C1C25;
border-bottom: 1rpx #3A3A40 solid;
}
......@@ -40,7 +41,7 @@ page {
width: 670rpx;
height: 396rpx;
margin: 76rpx auto 0;
padding: 64rpx 32rpx 32rpx 32rpx;
padding: 60rpx 32rpx 32rpx 32rpx;
background: #272733;
}
.movie-time-wrapper {
......@@ -83,7 +84,7 @@ page {
}
.movie-name-wrapper {
height: 40rpx;
margin: 0 0 12rpx 0;
margin: 0 0 20rpx 0;
overflow: hidden;
flex-wrap: wrap;
}
......
......@@ -43,6 +43,12 @@ let output = {
}
},
/**
* 计算字符串字符数量
* @function
* @param {string} - funcCountString 字符串
* @returns
*/
countStringChar: function (funcCountString) {
let funcCountDoubleByte = funcCountString.match(/[\uff00-\uffff]/ig)
let funcCountSingleByte = funcCountString.match(/[\u0000-\u00ff]/ig)
......@@ -55,7 +61,6 @@ let output = {
if (funcCountEmoji === null) funcCountEmoji = []
let funcCountStringChar = funcCountDoubleByte.length * 2 + funcCountSingleByte.length * 1 + funcCountChinese.length * 2 + funcCountEmoji.length * 1
console.log(funcCountStringChar)
return funcCountStringChar
},
}
......
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 sign in to comment