上传代码
This commit is contained in:
104
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.js
vendored
Normal file
104
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.js
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
const _sfc_main = {
|
||||
__name: "goToRemark",
|
||||
setup(__props) {
|
||||
const remark = common_vendor.ref("");
|
||||
const orderItem = common_vendor.ref(null);
|
||||
const getOrder = () => {
|
||||
const notPay = common_vendor.index.getStorageSync("notPay");
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/orders/get/my",
|
||||
method: "GET",
|
||||
data: {
|
||||
id: notPay
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
// 保设置正确的 Content-Type
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log("成功");
|
||||
if (res.data && res.data.data) {
|
||||
orderItem.value = res.data.data;
|
||||
console.log(orderItem.value);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log("失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onMounted(getOrder);
|
||||
const submitRemark = () => {
|
||||
var _a, _b, _c, _d;
|
||||
const notPay = common_vendor.index.getStorageSync("notPay");
|
||||
if (!notPay) {
|
||||
common_vendor.index.showToast({
|
||||
title: "订单ID未找到",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.showLoading({
|
||||
title: "正在提交备注..."
|
||||
});
|
||||
let currentTime = /* @__PURE__ */ new Date();
|
||||
let futureTime = new Date(currentTime.getTime() + 3600 * 1e3);
|
||||
futureTime.toISOString();
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/orders/updateOrder",
|
||||
method: "POST",
|
||||
data: {
|
||||
orderId: notPay,
|
||||
notes: remark.value,
|
||||
location: ((_a = orderItem.value) == null ? void 0 : _a.location) || "",
|
||||
pickupMethod: ((_b = orderItem.value) == null ? void 0 : _b.pickupMethod) || 0,
|
||||
pickupEndTime: ((_c = orderItem.value) == null ? void 0 : _c.pickupEndTime) || "",
|
||||
pickupStartTime: ((_d = orderItem.value) == null ? void 0 : _d.pickupStartTime) || ""
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
// 确保设置正确的 Content-Type
|
||||
"cookie": common_vendor.index.getStorageSync("cookie") || ""
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
common_vendor.index.showToast({
|
||||
title: "备注提交成功",
|
||||
duration: 2e3
|
||||
});
|
||||
common_vendor.index.navigateBack({
|
||||
delta: 1,
|
||||
// 返回上一页
|
||||
success() {
|
||||
common_vendor.index.$emit("updateRemark", remark.value);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
title: "备注提交失败",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: remark.value,
|
||||
b: common_vendor.o(($event) => remark.value = $event.detail.value),
|
||||
c: common_vendor.o(submitRemark)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8072c105"]]);
|
||||
wx.createPage(MiniProgramPage);
|
4
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.json
vendored
Normal file
4
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "去备注",
|
||||
"usingComponents": {}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="container data-v-8072c105"><view class="input-container data-v-8072c105"><block wx:if="{{r0}}"><textarea placeholder="请输入您的备注..." class="remark-input data-v-8072c105" value="{{a}}" bindinput="{{b}}"></textarea></block></view><button bindtap="{{c}}" class="submit-button data-v-8072c105">提交</button></view>
|
24
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.wxss
vendored
Normal file
24
uniapp04/unpackage/dist/dev/mp-weixin/pages/goToRemark/goToRemark.wxss
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
.container.data-v-8072c105 {
|
||||
padding: 20px;
|
||||
}
|
||||
.input-container.data-v-8072c105 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.remark-input.data-v-8072c105 {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 8px;
|
||||
resize: none; /* 止用户调整大小 */
|
||||
}
|
||||
.submit-button.data-v-8072c105 {
|
||||
width: 100%;
|
||||
background-color: #4095e5;
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
}
|
Reference in New Issue
Block a user