|
|
@@ -24,7 +24,7 @@ |
|
|
|
<checkbox-group @change="checkboxChange"> |
|
|
|
<checkbox :checked="state.checked" style="transform: scale(0.8)" />我已阅读并同意 |
|
|
|
</checkbox-group> |
|
|
|
<text style="color:#007AFF;text-decoration: underline;" @click="downAuthD()">《产品协议》</text> |
|
|
|
<text v-for="(item,index) in state.agreeURL" style="color:#007AFF;text-decoration: underline;" @click="downAuthD(item)">《{{item.name}}》</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@@ -96,12 +96,12 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
const downAuthD = () => { |
|
|
|
console.log('=======123') |
|
|
|
const downAuthD = (item) => { |
|
|
|
console.log('=======123',item) |
|
|
|
console.log("uni.env.USER_DATA_PATH '", uni.env.USER_DATA_PATH + '/' + '产品协议.docx') |
|
|
|
uni.downloadFile({ |
|
|
|
url: state.agreeURL, |
|
|
|
filePath: uni.env.USER_DATA_PATH + '/' + '产品协议.docx', |
|
|
|
url: item.url, |
|
|
|
filePath: uni.env.USER_DATA_PATH + '/' +item.name+ '.docx', |
|
|
|
success(res) { |
|
|
|
const filePath = res.filePath |
|
|
|
uni.openDocument({ |
|
|
@@ -180,7 +180,15 @@ |
|
|
|
getOpenID(); |
|
|
|
refresh(); |
|
|
|
if (option.url) { |
|
|
|
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + option.url |
|
|
|
let supAgreeArr=option.url.split(';') |
|
|
|
for(var k=0;k<supAgreeArr.length;k++){ |
|
|
|
let url=envs[process.env.NODE_ENV].baseUrl+supAgreeArr[k] |
|
|
|
let obj={ |
|
|
|
'url':url, |
|
|
|
'name':getStringBetween(url,'_','.docx') |
|
|
|
} |
|
|
|
state.agreeURL.push(obj) |
|
|
|
} |
|
|
|
state.typeScanCode = option.typeScanCode |
|
|
|
console.log("state.agreeURL", state.agreeURL) |
|
|
|
} else { |
|
|
@@ -213,7 +221,7 @@ |
|
|
|
isValueCard: "", |
|
|
|
dataArray: [], |
|
|
|
checked: false, |
|
|
|
agreeURL: "", |
|
|
|
agreeURL: [], |
|
|
|
typeScanCode: 0,//扫码进来得 |
|
|
|
vehicleId:"" |
|
|
|
}); |
|
|
@@ -273,16 +281,31 @@ |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
orderId: state.orderId, //订单编号 |
|
|
|
|
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}; |
|
|
|
request(getAgreementApi, options).then((res) => { |
|
|
|
let data = stringToJson(res.bizContent); |
|
|
|
state.agreeURL = envs[process.env.NODE_ENV].baseUrl + data.supAgree |
|
|
|
console.log("查协议", envs[process.env.NODE_ENV].baseUrl, data.supAgree, data) |
|
|
|
let supAgreeArr=data.supAgree.split(';') |
|
|
|
for(var k=0;k<supAgreeArr.length;k++){ |
|
|
|
let url=envs[process.env.NODE_ENV].baseUrl+supAgreeArr[k] |
|
|
|
let obj={ |
|
|
|
'url':url, |
|
|
|
'name':getStringBetween(url,'_','.docx') |
|
|
|
} |
|
|
|
state.agreeURL.push(obj) |
|
|
|
} |
|
|
|
console.log("查协议", state.agreeURL) |
|
|
|
}); |
|
|
|
} |
|
|
|
const getStringBetween=(str, start, end)=> { |
|
|
|
const startIndex = str.indexOf(start) + start.length; |
|
|
|
const endIndex = str.indexOf(end); |
|
|
|
if (startIndex >= endIndex) return ''; |
|
|
|
return str.substring(startIndex, endIndex); |
|
|
|
} |
|
|
|
const checkboxChange = (e) => { |
|
|
|
state.checked = !state.checked; |
|
|
|
console.log(state.checked); |