Commit 00e983a4 authored by verestrasz's avatar verestrasz

update

parent 8ecbd060
...@@ -18,7 +18,6 @@ class MFetch { ...@@ -18,7 +18,6 @@ class MFetch {
console.info('better alert better experience~') console.info('better alert better experience~')
alertServerErrMsg = window.alert alertServerErrMsg = window.alert
} }
this.apiConfig = apiConfig this.apiConfig = apiConfig
this.verify = verify this.verify = verify
this.alertServerErrMsg = alertServerErrMsg this.alertServerErrMsg = alertServerErrMsg
...@@ -41,7 +40,12 @@ class MFetch { ...@@ -41,7 +40,12 @@ class MFetch {
let error = new Error('clearAdminInfo') let error = new Error('clearAdminInfo')
throw error throw error
} else { } else {
let error = new Error(response.statusText) let error
if(response.data.message==="repetitive_operation_fail"){
error = new Error("请勿重复操作!")
}else{
error = new Error(response.statusText)
}
error.response = response error.response = response
throw error throw error
} }
...@@ -67,6 +71,7 @@ class MFetch { ...@@ -67,6 +71,7 @@ class MFetch {
requireAuth = true, requireAuth = true,
isUpload = false, isUpload = false,
onUploadProgress, onUploadProgress,
header={}
} = config } = config
if (!type || !this.httpMap[type]) { if (!type || !this.httpMap[type]) {
...@@ -87,7 +92,8 @@ class MFetch { ...@@ -87,7 +92,8 @@ class MFetch {
'ip': '0.0.0.0', 'ip': '0.0.0.0',
'version': '1.0.0', 'version': '1.0.0',
'platform': 'chrome', 'platform': 'chrome',
'type': 2 'type': 2,
...header
} }
if (isUpload) { if (isUpload) {
headers['Content-Type'] = 'multipart/form-data' headers['Content-Type'] = 'multipart/form-data'
......
...@@ -241,3 +241,6 @@ export const getTransferOrderList = { ...@@ -241,3 +241,6 @@ export const getTransferOrderList = {
export const getTransferOrderDetail = { export const getTransferOrderDetail = {
} }
export const getCreatApiToken = {
url:"/apiToken/creatApiToken"
}
...@@ -92,10 +92,14 @@ export const OrderMixin = { ...@@ -92,10 +92,14 @@ export const OrderMixin = {
// return this.commBtn ? [this.commBtn].concat(arr) : arr // return this.commBtn ? [this.commBtn].concat(arr) : arr
return arr return arr
}, },
handleCancelOrder() { async handleCancelOrder() {
this.$showLoading(); let apiToken=await this.getApiToken()
if(apiToken){
this.$api({ this.$api({
apiName: "cancelOrder", apiName: "cancelOrder",
header:{
"apiToken":apiToken
},
postData: this.data.payId, postData: this.data.payId,
success: () => { success: () => {
this.data.orderState = OrderStatus.CLOSE; this.data.orderState = OrderStatus.CLOSE;
...@@ -104,6 +108,35 @@ export const OrderMixin = { ...@@ -104,6 +108,35 @@ export const OrderMixin = {
this.$hideLoading(); this.$hideLoading();
}, },
}); });
this.$api({
apiName: "cancelOrder",
header:{
"apiToken":apiToken
},
postData: this.data.payId,
success: () => {
this.data.orderState = OrderStatus.CLOSE;
},
complete: () => {
this.$hideLoading();
},
});
}else{
this.$hideLoading();
}
},
getApiToken(){
this.$showLoading();
return new Promise(reslove=>{
this.$api({
apiName:"getCreatApiToken",
success:(res)=>{
reslove(res)
}
})
})
}, },
handleCancelRefund() { handleCancelRefund() {
this.$showLoading(); this.$showLoading();
......
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
<div class="header"> <div class="header">
商品详情 商品详情
</div> </div>
<div class="detail" v-html="data && data.detail" style="padding:0 10px"></div> <div class="detail" v-html="data && getHtml(data.detail)" v-finishHtml></div>
</div> </div>
<van-popup v-model="showPopup" position="bottom" round closeable> <van-popup v-model="showPopup" position="bottom" round closeable>
<div class="blind-rule"> <div class="blind-rule">
<div class="title">规则说明</div> <div class="title">规则说明</div>
<div class="content" v-html="data && data.blindBoxRule" style="padding:0 10px"></div> <div class="content" v-html="data && getHtml(data.blindBoxRule)"></div>
</div> </div>
</van-popup> </van-popup>
</div> </div>
...@@ -46,6 +46,18 @@ ...@@ -46,6 +46,18 @@
<script> <script>
export default { export default {
directives:{
finishHtml:{
update(el) {
let children=el.childNodes
for(let item of children){
if(item.style.paddingLeft!=='10px'){
item.style.padding="0 10px"
}
}
}
},
},
props: { props: {
data: { data: {
type: Object, type: Object,
...@@ -62,6 +74,16 @@ export default { ...@@ -62,6 +74,16 @@ export default {
methods: { methods: {
handleRule() { handleRule() {
this.showPopup = true this.showPopup = true
},
getHtml(data){
if(data){
var regex1 = new RegExp("(i?)(\<p)(?!(.*?style=['\"](.*)['\"])[^\>]+\>)", 'g')
data = data.replace(regex1, '$2 style="padding:0 10px"$3')
return data
}else{
return ""
}
} }
}, },
}; };
...@@ -146,5 +168,8 @@ export default { ...@@ -146,5 +168,8 @@ export default {
font-size: 14px; font-size: 14px;
} }
} }
.getHtml{
padding: 0 10px;
}
} }
</style> </style>
\ No newline at end of file
...@@ -63,9 +63,9 @@ module.exports = { ...@@ -63,9 +63,9 @@ module.exports = {
// target: 'http://146.56.197.42:12009' // target: 'http://146.56.197.42:12009'
// target: 'http://172.22.20.64:8100/root' // target: 'http://172.22.20.64:8100/root'
// target: 'http://172.22.17.176:12008' // target: 'http://172.22.17.176:12008'
// target: 'http://172.22.17.108:12008' // target: 'http://172.22.17.108:9089'
target: 'https://mall.inmvo.com/root' // target: 'https://mall.inmvo.com/root'
// target: 'https://testym.8n.cn/root' target: 'https://testym.8n.cn/root'
}, },
'/chat': { '/chat': {
pathRewrite: { pathRewrite: {
......
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 to comment