Commit 9f34c73e by wjw

ww-订单评价

parent 89b09175
...@@ -9,7 +9,10 @@ Page({ ...@@ -9,7 +9,10 @@ Page({
scoreProductText: '0.0', scoreProductText: '0.0',
scoreEnvironment: 0, // 环境分数 scoreEnvironment: 0, // 环境分数
scoreEnvironmentText: '0.0', scoreEnvironmentText: '0.0',
content: '', // 评价内容,
imgUrls: [], // 评价图片
orderInfo: { orderInfo: {
orderId: '02aaa9a62d5645c59109218c27d2174a',
name: '精灵鸟理想国年卡', name: '精灵鸟理想国年卡',
price: '1680.00', price: '1680.00',
quantity: 4, quantity: 4,
...@@ -18,16 +21,16 @@ Page({ ...@@ -18,16 +21,16 @@ Page({
id: 0, id: 0,
imgUrl: '' imgUrl: ''
}, },
// { {
// id: 1, id: 1,
// imgUrl: '' imgUrl: ''
// }, },
// { {
// id: 2, id: 2,
// imgUrl: '' imgUrl: ''
// }
]
} }
]
},
}, },
/** /**
...@@ -37,6 +40,7 @@ Page({ ...@@ -37,6 +40,7 @@ Page({
* @returns * @returns
*/ */
onChangeScore: function (event) { onChangeScore: function (event) {
// type 1: 服务评价 2: 产品评价 3: 环境评价
const { index, type } = event.currentTarget.dataset const { index, type } = event.currentTarget.dataset
console.log(index, type) console.log(index, type)
let { scoreServe, scoreProduct, scoreEnvironment } = this.data let { scoreServe, scoreProduct, scoreEnvironment } = this.data
...@@ -67,6 +71,62 @@ Page({ ...@@ -67,6 +71,62 @@ Page({
* @returns * @returns
*/ */
eventInputDone: function (event) { eventInputDone: function (event) {
// console.log(event.detail.value) let content = event.detail.value
this.setData({
content
})
},
/**
* 新增评价图片
* @function
* @param
* @returns
*/
eventImageAdd: function (event) {
console.log(event.detail.all[0])
let imgUrl = event.detail.all[0].url
let imgUrls = []
imgUrls.push(imgUrl)
this.setData({
imgUrls
})
},
/**
* 移除评价图片
* @function
* @param
* @returns
*/
eventImageRemove: function (event) {
console.log(event.detail.all)
},
/**
* 提交订单
* @function
* @param
* @returns
*/
onSubmitCommennt: function () {
console.log('submit')
let funcFile = this.data.imgUrls[0]
wx.uploadFile({
url: App.globalData.baseUrl + '/api/v1/common/upload',
filePath: funcFile,
name: 'file',
header: {
'Content-Type': 'multipart/form-data',
'token': App.globalData.token
},
success: (res) => {
console.log(res)
}
})
// let formData = {}
// formData.orderId = this.data.orderInfo.orderId
// formData.imgUrls = '',
// formData.serviceEvaluation = this.data.scoreServe
// formData.productEvaluation = this.data.scoreProduct
// formData.environmentalEvaluation = this.data.scoreEnvironment
// formData.content = this.data.content
} }
}) })
\ No newline at end of file
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<view class="order-comment"> <view class="order-comment">
<l-textarea placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200" l-class="l-textarea" border="{{false}}" bind:linblur="eventInputDone" /> <l-textarea placeholder="您的评价与建议,会让园区做的更好" placeholder-style="color: #C2C7CF" maxlength="200" l-class="l-textarea" border="{{false}}" bind:linblur="eventInputDone" />
<view class="order-picker"> <view class="order-picker">
<l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed" custom="{{true}}"> <l-image-picker l-item-class="l-image-item" l-class="l-picker" count="9" size="3" size-type="compressed" custom="{{true}}" bind:linchange="eventImageAdd" bind:linremove="eventImageRemove">
<view class="col con-c align-c"> <view class="col con-c align-c">
<image class="icon-img"></image> <image class="icon-img"></image>
<text>添加图片</text> <text>添加图片</text>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</view> </view>
</view> </view>
<view class="footer-wrapper"> <view class="footer-wrapper">
<view class="comment-btn"> <view class="comment-btn" bindtap="onSubmitCommennt">
<text>提交评价</text> <text>提交评价</text>
</view> </view>
</view> </view>
......
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
}, },
{ {
"id": 11, "id": 11,
"name": "pages/play/movie-detail/movie-detail", "name": "pages/play/movie/movie",
"pathName": "pages/play/movie-detail/movie-detail", "pathName": "pages/play/movie/movie",
"query": "", "query": "",
"scene": null "scene": null
}, },
...@@ -159,6 +159,13 @@ ...@@ -159,6 +159,13 @@
"pathName": "pages/play/home/home", "pathName": "pages/play/home/home",
"query": "", "query": "",
"scene": null "scene": null
},
{
"id": -1,
"name": "pages/play/service-detail/service-detail",
"pathName": "pages/play/service-detail/service-detail",
"query": "",
"scene": null
} }
] ]
} }
......
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