Commit 00e983a4 authored by verestrasz's avatar verestrasz

update

parent 8ecbd060
......@@ -18,7 +18,6 @@ class MFetch {
console.info('better alert better experience~')
alertServerErrMsg = window.alert
}
this.apiConfig = apiConfig
this.verify = verify
this.alertServerErrMsg = alertServerErrMsg
......@@ -41,7 +40,12 @@ class MFetch {
let error = new Error('clearAdminInfo')
throw error
} 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
throw error
}
......@@ -67,6 +71,7 @@ class MFetch {
requireAuth = true,
isUpload = false,
onUploadProgress,
header={}
} = config
if (!type || !this.httpMap[type]) {
......@@ -87,7 +92,8 @@ class MFetch {
'ip': '0.0.0.0',
'version': '1.0.0',
'platform': 'chrome',
'type': 2
'type': 2,
...header
}
if (isUpload) {
headers['Content-Type'] = 'multipart/form-data'
......
......@@ -241,3 +241,6 @@ export const getTransferOrderList = {
export const getTransferOrderDetail = {
}
export const getCreatApiToken = {
url:"/apiToken/creatApiToken"
}
......@@ -92,10 +92,14 @@ export const OrderMixin = {
// return this.commBtn ? [this.commBtn].concat(arr) : arr
return arr
},
handleCancelOrder() {
this.$showLoading();
async handleCancelOrder() {
let apiToken=await this.getApiToken()
if(apiToken){
this.$api({
apiName: "cancelOrder",
header:{
"apiToken":apiToken
},
postData: this.data.payId,
success: () => {
this.data.orderState = OrderStatus.CLOSE;
......@@ -104,6 +108,35 @@ export const OrderMixin = {
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() {
this.$showLoading();
......
......@@ -33,12 +33,12 @@
<div class="header">
商品详情
</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>
<van-popup v-model="showPopup" position="bottom" round closeable>
<div class="blind-rule">
<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>
</van-popup>
</div>
......@@ -46,6 +46,18 @@
<script>
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: {
data: {
type: Object,
......@@ -62,6 +74,16 @@ export default {
methods: {
handleRule() {
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 {
font-size: 14px;
}
}
.getHtml{
padding: 0 10px;
}
}
</style>
\ No newline at end of file
......@@ -63,9 +63,9 @@ module.exports = {
// target: 'http://146.56.197.42:12009'
// target: 'http://172.22.20.64:8100/root'
// target: 'http://172.22.17.176:12008'
// target: 'http://172.22.17.108:12008'
target: 'https://mall.inmvo.com/root'
// target: 'https://testym.8n.cn/root'
// target: 'http://172.22.17.108:9089'
// target: 'https://mall.inmvo.com/root'
target: 'https://testym.8n.cn/root'
},
'/chat': {
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