添加 订单备注

This commit is contained in:
Kiyan 2017-05-26 15:27:39 +08:00
parent d3bd6d248d
commit d65fdc8f92
11 changed files with 157 additions and 10 deletions

View File

@ -1,12 +1,13 @@
{
"pages": [
"pages/index/index",
"pages/order/list",
"pages/order/show",
"pages/order/quasi",
"pages/order/content",
"pages/mine/coupon",
"pages/shop/show",
"pages/mine/mine",
"pages/order/list",
"pages/order/review",
"pages/index/search",
"pages/index/category",

View File

@ -0,0 +1,99 @@
// pages/order/content.js
import {
getPrevPage
} from '../../utils/util'
const limit = 50
Page({
/**
* 页面的初始数据
*/
data: {
limit,
content: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.callback = options.callback || 'callback'
var {content} = options
if (content) {
this.setData({
content
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
onContentInput(e) {
var {value} = e.detail
var {content} = this.data
if (value.length <= limit) {
this.setData({
content: value
})
} else {
this.setData({
content
})
}
},
onSaveTap(e) {
var {content} = this.data
var cb = getPrevPage()[this.callback]
cb && cb(content)
wx.navigateBack({
delta: 1,
})
}
})

View File

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "附加信息"
}

View File

@ -0,0 +1,15 @@
<!--pages/order/content.wxml-->
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell">
<view class="weui-cell__bd">
<textarea bindinput="onContentInput" value="{{content}}" class="weui-textarea" placeholder="口味, 偏好等要求" style="height: 3.3em" />
<view class="weui-textarea-counter">{{content.length}}/{{limit}}</view>
</view>
</view>
</view>
<view class="button-sp-area">
<button bindtap="onSaveTap" disabled="{{disabled}}" class="weui-btn" type="primary" loading="{{loading}}">
确定
</button>
</view>

View File

@ -0,0 +1 @@
/* pages/order/content.wxss */

View File

@ -9,11 +9,11 @@ import {
} from '../../utils/util'
Page({
data: {
content: ''
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
this.id = options.id || '2825'
this.id = options.id || '2843'
this.loadData()
},
onReady: function () {
@ -116,10 +116,15 @@ Page({
}
})
},
callbackContent(content) {
this.setData({
content
})
},
onAddOrder(e) {
var that = this
var {id} = this
var {loading} = this.data
var {loading, content} = this.data
if (loading) {
return
}
@ -127,6 +132,7 @@ Page({
loading: true
})
addOrder({
remark: content,
quasi_order_id: id,
success(data) {
var order_id = data['order']['order_id']

View File

@ -19,6 +19,7 @@
<view class="weui-cell__bd">支付方式</view>
<view class="">在线支付</view>
</view>
<navigator url="/pages/mine/coupon?id={{info.user_coupon_id}}&callback=callbackCoupon" wx:if="{{info.user_coupon_id}}" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__bd">红包</view>
<view class="weui-cell__ft_in-access">¥{{info.coupon_money}}</view>
@ -28,6 +29,7 @@
<view class="weui-cell__ft">暂无可用</view>
</view>
</view>
<view class="quasi-goods">
<view class="quasi-goods__hd">
<image class="quasi-goods__img" src="/images/shop-512.png"></image>
@ -75,6 +77,15 @@
</view>
</view>
</view>
<view class="weui-cells">
<navigator url="./content?callback=callbackContent&content={{content}}" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__bd weui-cell__bd_content">备注</view>
<view>{{content}}</view>
<view class="weui-cell__ft weui-cell__ft_in-access">{{content ? '' : '口味, 偏好等要求'}}</view>
</navigator>
</view>
</view>
<view class="quasi-actions">
<view class="quasi-actions__cut">已优惠¥{{info.cut_money_total}}</view>

View File

@ -7,6 +7,9 @@
.weui-media-box_address::after {
right: 15px;
}
.weui-cell__bd_content {
min-width: 4em;
}
/* quasi-goods */
@ -95,4 +98,4 @@
}
.menu-cart__btn::after {
content: none;
}
}

View File

@ -24,7 +24,7 @@ Page({
},
onLoad: function (options) {
// 页面初始化 options为页面跳转所带来的参数
this.id = options.id || 1488
this.id = options.id || 1497
this.loadData()
},
onReady: function () {

View File

@ -1,11 +1,10 @@
<!--pages/order/show.wxml-->
<view class="order-show-tab tab">
<view class="tab__navbar">
<view bindtap="navChange" id="{{index}}" wx:for="{{tabNavs}}" wx:key="{{index}}" class="tab__navbar-item {{index == activeNavIndex? 'tab__navbar-item_active': ''}} ">
订单状态
</view>
<view bindtap="onPhoneTap" class="phone">
<view bindtap="onPhoneTap" class="phone">
<image class="phone__icon" src="/images/chat_phone_normal.png"></image>
</view>
</view>
@ -110,6 +109,7 @@
</view>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
配送服务
@ -118,6 +118,14 @@
爱跑腿专送
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd">
备注
</view>
<view class="weui-cell__bd">
{{info.remark || '无'}}
</view>
</view>
</view>
<view class="weui-cells__title">订单信息</view>
<view class="weui-cells weui-cells_after-title">

View File

@ -397,7 +397,7 @@ export function updateOrderCoupon(options) {
// 添加订单
export function addOrder(options) {
var {
quasi_order_id,
quasi_order_id, remark,
success, error
} = options
getApp().getLoginInfo(loginInfo => {
@ -409,7 +409,7 @@ export function addOrder(options) {
url: 'index.php?m=Mall&c=Order&a=addOrder',
data: {
user_id, user_token,
quasi_order_id
quasi_order_id, remark
},
success, error
})