提交 7de0dabe 编写于 作者: D devil_gong

小程序订单商品评论

上级 b3a6190b
......@@ -302,7 +302,7 @@ textarea {
line-height: 70rpx;
}
.form-container .form-gorup textarea {
padding: 0;
padding: 10rpx;
min-height: 70rpx;
}
......@@ -315,8 +315,8 @@ textarea {
}
.form-container-upload .form-upload-data .delete-icon {
position: absolute;
top: 15rpx;
right: 15rpx;
top: 12rpx;
right: 12rpx;
color: #e5e5e5;
background-color: #d9534f;
padding: 5rpx 18rpx;
......
......@@ -64,8 +64,8 @@ App({
// 请求地址
request_url: "{{request_url}}",
// request_url: 'http://tp5-dev.com/',
// request_url: 'http://test.shopxo.net/',
request_url: 'http://tp5-dev.com/',
request_url: 'http://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
......
{
"pages": [
"pages": ["pages/user-order/user-order",
"pages/index/index",
"pages/goods-category/goods-category",
"pages/cart/cart",
......@@ -14,7 +14,7 @@
"pages/buy/buy",
"pages/user-address/user-address",
"pages/user-address-save/user-address-save",
"pages/user-order/user-order",
"pages/user-order-detail/user-order-detail",
"pages/user-order-comments/user-order-comments",
"pages/user-faovr/user-faovr",
......@@ -28,7 +28,7 @@
"pages/user-orderaftersale-detail/user-orderaftersale-detail"
],
"window": {
"defaultTitle": "{{application_title}}",
"defaultTitle": "shopxo",
"titleBarColor": "#d2364c"
},
"tabBar": {
......
......@@ -36,5 +36,9 @@
height: 110rpx;
}
.anonymous .tips-text {
margin-top: 10rpx;
margin-top: 5rpx;
}
.anonymous switch {
vertical-align: middle;
margin-right: 5rpx;
}
\ No newline at end of file
<view wx:if="{{detail != null}}">
<form bindsubmit="formSubmit" class="form-container">
<view wx:for="{{detail.items}}" wx:key="item" class="form-gorup bg-white oh">
<view a:if="{{detail != null}}">
<form onSubmit="formSubmit" class="form-container">
<view a:for="{{detail.items}}" class="form-gorup bg-white oh">
<view class="oh">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
<image class="goods-image fl br" src="{{item.images}}" mode="aspectFill" />
</navigator>
<view class="item-base">
<block wx:for="{{[1,2,3,4,5]}}" wx:key="tx" wx:for-index="tx">
<image class="xingxing-icon" src="/images/default-xingxing-icon{{form_rating_list[index] != undefined && form_rating_list[index] >= item ? '-active' : ''}}.png" mode="aspectFill" bindtap="rating_event" data-index="{{index}}" data-value="{{item}}" />
<block a:for="{{[1,2,3,4,5]}}" a:key="tx" a:for-index="tx">
<image class="xingxing-icon" src="/images/default-xingxing-icon{{form_rating_list[index] != undefined && form_rating_list[index] >= item ? '-active' : ''}}.png" mode="aspectFill" onTap="rating_event" data-index="{{index}}" data-value="{{item}}" />
</block>
<text wx:if="{{form_rating_list[index] != undefined}}" class="msg-text cr-888">{{rating_msg[form_rating_list[index]-1]}}</text>
<text a:if="{{form_rating_list[index] != undefined}}" class="msg-text cr-888">{{rating_msg[form_rating_list[index]-1]}}</text>
</view>
</view>
<view class="form-content">
<textarea bindinput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="退宝贝满足你的期待吗?说说它的有点和美中不足的地方吧" maxlength="230" value="{{form_msg}}" />
<view class="form-content br-t">
<textarea onInput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="宝贝满足你的期待吗?说说它的优点和美中不足的地方吧" maxlength="230" />
<view class="form-container-upload oh">
<view class="form-upload-data fl">
<block wx:if="{{(form_images_list[index] || null) != null && form_images_list[index].length > 0}}">
<view wx:for="{{form_images_list[index]}}" wx:key="item" wx:for-index="ix" class="item fl">
<text class="delete-icon" bindtap="upload_delete_event" data-index="{{index}}" data-ix="{{ix}}">x</text>
<image src="{{item}}" bindtap="upload_show_event" data-index="{{index}}" data-ix="{{ix}}" mode="aspectFill" />
<block a:if="{{(form_images_list[index] || null) != null && form_images_list[index].length > 0}}">
<view a:for="{{form_images_list[index]}}" a:for-index="ix" class="item fl">
<text class="delete-icon" onTap="upload_delete_event" data-index="{{index}}" data-ix="{{ix}}">x</text>
<image src="{{item}}" onTap="upload_show_event" data-index="{{index}}" data-ix="{{ix}}" mode="aspectFill" />
</view>
</block>
</view>
<image wx:if="{{(form_images_list[index] || null) == null || form_images_list[index].length < 3}}" class="upload-icon" src="/images/default-upload-icon.png" mode="aspectFill" bindtap="file_upload_event" data-index="{{index}}" />
<image a:if="{{(form_images_list[index] || null) == null || form_images_list[index].length < 3}}" class="upload-icon" src="/images/default-upload-icon.png" mode="aspectFill" onTap="file_upload_event" data-index="{{index}}" />
</view>
</view>
</view>
<view class="form-gorup bg-white anonymous">
<switch name="is_anonymous" bindchange="anonymous_event" />
<switch name="is_anonymous" onChange="anonymous_event" />
<text class="cr-666">匿名</text>
<text class="fr cr-888 tips-text">{{anonymous_msg_list[anonymous_value]}}</text>
</view>
......@@ -40,7 +40,7 @@
</form>
</view>
<view wx:if="{{detail == null}}">
<import src="/pages/common/nodata.wxml" />
<view a:if="{{detail == null}}">
<import src="/pages/common/nodata.axml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
\ No newline at end of file
......@@ -23,17 +23,17 @@ Page({
},
onShow() {
wx.setNavigationBarTitle({ title: app.data.common_pages_title.user_order_comments });
my.setNavigationBar({title: app.data.common_pages_title.user_order_comments });
},
init() {
var self = this;
wx.showLoading({ title: "加载中..." });
my.showLoading({ title: "加载中..." });
this.setData({
data_list_loding_status: 1
});
wx.request({
my.request({
url: app.get_request_url("comments", "order"),
method: "POST",
data: {
......@@ -41,8 +41,8 @@ Page({
},
dataType: "json",
success: res => {
wx.hideLoading();
wx.stopPullDownRefresh();
my.hideLoading();
my.stopPullDownRefresh();
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
......@@ -60,8 +60,8 @@ Page({
}
},
fail: () => {
wx.hideLoading();
wx.stopPullDownRefresh();
my.hideLoading();
my.stopPullDownRefresh();
self.setData({
data_list_loding_status: 2,
data_list_loding_msg: '服务器请求出错',
......@@ -73,20 +73,20 @@ Page({
// 上传图片预览
upload_show_event(e) {
var index = e.currentTarget.dataset.index;
var ix = e.currentTarget.dataset.ix;
wx.previewImage({
current: this.data.form_images_list[index][ix],
var index = e.target.dataset.index;
var ix = e.target.dataset.ix;
my.previewImage({
current: ix,
urls: this.data.form_images_list[index],
});
},
// 图片删除
upload_delete_event(e) {
var index = e.currentTarget.dataset.index;
var ix = e.currentTarget.dataset.ix;
var index = e.target.dataset.index;
var ix = e.target.dataset.ix;
var self = this;
wx.showModal({
my.confirm({
title: '温馨提示',
content: '删除后不可恢复、继续吗?',
success(res) {
......@@ -104,7 +104,7 @@ Page({
// 文件上传
file_upload_event(e) {
// 数据初始化
var index = e.currentTarget.dataset.index;
var index = e.target.dataset.index;
var temp_list = this.data.form_images_list;
var length = this.data.detail.items.length;
for (var i = 0; i < length; i++) {
......@@ -116,7 +116,7 @@ Page({
// 处理上传文件
var self = this;
wx.chooseImage({
my.chooseImage({
count: 3,
success(res) {
var success = 0;
......@@ -132,7 +132,7 @@ Page({
upload_one_by_one(index, img_paths, success, fail, count, length) {
var self = this;
if ((self.data.form_images_list[index] || null) == null || self.data.form_images_list[index].length < 3) {
wx.uploadFile({
my.uploadFile({
url: app.get_request_url("index", "ueditor"),
filePath: img_paths[count],
name: 'upfile',
......@@ -182,8 +182,8 @@ Page({
// 评分事件
rating_event(e) {
// 参数
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
var index = e.target.dataset.index;
var value = e.target.dataset.value;
// 数据初始化/赋值
var temp_list = this.data.form_rating_list;
......@@ -205,7 +205,7 @@ Page({
// 评论内容
form_content_event(e) {
// 参数
var index = e.currentTarget.dataset.index;
var index = e.target.dataset.index;
var value = e.detail.value;
// 数据初始化/赋值
......@@ -284,20 +284,20 @@ Page({
// 提交表单
var self = this;
wx.showLoading({ title: "处理中..." });
my.showLoading({ title: "处理中..." });
self.setData({ form_button_disabled: true });
wx.request({
my.request({
url: app.get_request_url("commentssave", "order"),
method: "POST",
data: form_data,
dataType: "json",
header: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
wx.hideLoading();
my.hideLoading();
if (res.data.code == 0) {
app.showToast(res.data.msg, "success");
setTimeout(function () {
wx.navigateBack();
my.navigateBack();
}, 2000);
} else {
self.setData({ form_button_disabled: false });
......@@ -305,7 +305,7 @@ Page({
}
},
fail: () => {
wx.hideLoading();
my.hideLoading();
self.setData({ form_button_disabled: false });
app.showToast("服务器请求出错");
}
......
{
"enablePullDownRefresh": true
"pullRefresh": true
}
\ No newline at end of file
......@@ -41,11 +41,11 @@ Page({
params: params,
nav_status_index: nav_status_index,
});
this.init();
},
onShow() {
my.setNavigationBar({title: app.data.common_pages_title.user_order});
this.init();
},
init() {
......
......@@ -60,7 +60,7 @@ App({
// 请求地址
request_url: "{{request_url}}",
request_url: 'http://tp5-dev.com/',
// request_url: 'https://test.shopxo.net/',
request_url: 'https://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
......
......@@ -36,5 +36,8 @@
height: 110rpx;
}
.anonymous .tips-text {
margin-top: 10rpx;
margin-top: 5rpx;
}
.anonymous switch {
vertical-align: middle;
}
\ No newline at end of file
......@@ -175,7 +175,8 @@ Page({
// 是否匿名事件
anonymous_event(e) {
this.setData({ anonymous_value: e.detail.value == true ? 1 : 0 });
console.log(e)
this.setData({ anonymous_value: e.detail.checked == true ? 1 : 0 });
},
// 评分事件
......
......@@ -12,8 +12,8 @@
<text s-if="form_rating_list[index] != undefined" class="msg-text cr-888">{{rating_msg[form_rating_list[index]-1]}}</text>
</view>
</view>
<view class="form-content">
<textarea bindinput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="退宝贝满足你的期待吗?说说它的有点和美中不足的地方吧" maxlength="230" value="{=form_msg=}" />
<view class="form-content br-t">
<textarea bindinput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="宝贝满足你的期待吗?说说它的优点和美中不足的地方吧" maxlength="230" />
<view class="form-container-upload oh">
<view class="form-upload-data fl">
<block s-if="(form_images_list[index] || null) != null && form_images_list[index].length > 0">
......
......@@ -34,11 +34,11 @@ Page({
params: params,
nav_status_index: nav_status_index
});
this.init();
},
onShow() {
swan.setNavigationBarTitle({ title: app.data.common_pages_title.user_order });
this.init();
},
init() {
......
......@@ -65,7 +65,7 @@ App({
// 请求地址
request_url: "{{request_url}}",
request_url: 'http://tp5-dev.com/',
//request_url: 'https://test.shopxo.net/',
request_url: 'https://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
......
......@@ -12,8 +12,8 @@
<text wx:if="{{form_rating_list[index] != undefined}}" class="msg-text cr-888">{{rating_msg[form_rating_list[index]-1]}}</text>
</view>
</view>
<view class="form-content">
<textarea bindinput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="退宝贝满足你的期待吗?说说它的有点和美中不足的地方吧" maxlength="230" value="{{form_msg}}" />
<view class="form-content br-t">
<textarea bindinput="form_content_event" data-index="{{index}}" placeholder-class="cr-ccc" class="cr-666" placeholder="宝贝满足你的期待吗?说说它的优点和美中不足的地方吧" maxlength="230" />
<view class="form-container-upload oh">
<view class="form-upload-data fl">
<block wx:if="{{(form_images_list[index] || null) != null && form_images_list[index].length > 0}}">
......
......@@ -36,5 +36,8 @@
height: 110rpx;
}
.anonymous .tips-text {
margin-top: 10rpx;
margin-top: 5rpx;
}
.anonymous switch {
vertical-align: middle;
}
\ No newline at end of file
......@@ -41,11 +41,11 @@ Page({
params: params,
nav_status_index: nav_status_index,
});
this.init();
},
onShow() {
wx.setNavigationBarTitle({title: app.data.common_pages_title.user_order});
this.init();
},
init() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册