|
@@ -2,7 +2,7 @@
|
|
|
import {Field, CellGroup,Popup,Dialog,Toast} from 'vant';
|
|
|
import {ref,reactive,onMounted} from 'vue'
|
|
|
import {calculateDistance,trim} from '../../util/computerMark';
|
|
|
-import { onActivated } from 'vue';
|
|
|
+import { onActivated,onDeactivated } from 'vue';
|
|
|
import bridge from 'dsbridge';
|
|
|
import * as axios from 'axios';
|
|
|
import eruda from "eruda";
|
|
@@ -48,7 +48,6 @@ onActivated(function() {
|
|
|
}
|
|
|
init();
|
|
|
});
|
|
|
-
|
|
|
// eruda.init();
|
|
|
function markIn(data){
|
|
|
if(!judgeLogin()) {
|
|
@@ -201,7 +200,7 @@ function submit(){
|
|
|
if(is_form.value == '1' && is_punch.value == '1' ){
|
|
|
return;
|
|
|
}
|
|
|
- if(selectValue.value =="" || inputValue.value =="" || selectsecValue.value=="" || inputError.value ){
|
|
|
+ if(selectValue.value =="" || inputValue.value =="" || selectsecValue.value=="" || !inputValue.value.includes("https") ){
|
|
|
popupErrorShow.value=true;
|
|
|
popupShow.value =true;
|
|
|
return;
|
|
@@ -223,9 +222,28 @@ function submit(){
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+// app里调的方法
|
|
|
+bridge.register("onClose",()=>{
|
|
|
+ let obj = {
|
|
|
+ value1:inputValue.value,
|
|
|
+ value2:selectValue.value,
|
|
|
+ value3:selectsecValue.value
|
|
|
+ }
|
|
|
+ let str = JSON.stringify(obj);
|
|
|
+ bridge.call("saveStorageObject",{
|
|
|
+ key:"mdbuffer",
|
|
|
+ value:str
|
|
|
+ });
|
|
|
+
|
|
|
+ return {
|
|
|
+ key:"mdbuffer",
|
|
|
+ value:str
|
|
|
+ };
|
|
|
+})
|
|
|
+
|
|
|
// 初始化获取接口
|
|
|
-function init() {
|
|
|
-
|
|
|
+ function init() {
|
|
|
+ var mdBuffer = bridge.call("getStorageObject","mdbuffer");
|
|
|
axios.all([getLocation({}),getClockIn({})]).then(axios.spread(function (pointsRes, res2) {
|
|
|
console.log('res1',pointsRes.data); // 获取商店经纬度
|
|
|
console.log('res2',res2.data); // 是否填表单与签到
|
|
@@ -256,10 +274,19 @@ function init() {
|
|
|
inputImg.value = 'https://cdn.alipearlhair.com/media/wysiwyg/zpage/1689923307.png';
|
|
|
}else{
|
|
|
inputImg.value = 'https://cdn.alipearlhair.com/media/wysiwyg/zpage/1689923306.png';
|
|
|
+ if(mdBuffer){
|
|
|
+ // console.log("ccccccccccc",typeof(mdBuffer));
|
|
|
+ let obj =JSON.parse(mdBuffer);
|
|
|
+ // console.log("cccccccccccobj",obj);
|
|
|
+ inputValue.value = obj.value1;
|
|
|
+ selectValue.value = obj.value2;
|
|
|
+ selectsecValue.value =obj.value3;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
|
-
|
|
|
+bridge.call("api_closeWeb","1");
|
|
|
function expiredTokenHandler(err) {
|
|
|
if(err.code === -1) {
|
|
|
Dialog.confirm({
|
|
@@ -366,10 +393,7 @@ function toCoupons(){
|
|
|
<field v-model="selectValue" label="" @click="selectOnblur()" :readonly="true" :right-icon="selectImg" placeholder="* FILL IN THE CONTENT" />
|
|
|
</cell-group>
|
|
|
<div class="selectOne" v-show="selectflag" >
|
|
|
- <p v-for="(item,index) in showselect " @click="selectOneVlue(item)" >{{ item }}</p>
|
|
|
- <!-- <p>Alipearl Offline Store</p>
|
|
|
- <p>Alipearl Online Store</p>
|
|
|
- <p>From friends</p> -->
|
|
|
+ <p v-for="(item,index) in showselect " @click="selectOneVlue(item)" >{{ item }}</p>
|
|
|
</div>
|
|
|
<p>SALES’NAME</p>
|
|
|
<cell-group inset>
|
|
@@ -377,9 +401,6 @@ function toCoupons(){
|
|
|
</cell-group>
|
|
|
<div class="selectOne" v-show="selectsecflag" >
|
|
|
<p v-for="(item,index) in showsecselect " @click="selectSecVlue(item)" >{{ item }}</p>
|
|
|
- <!-- <p>Alipearl Offline Store</p>
|
|
|
- <p>Alipearl Online Store</p>
|
|
|
- <p>From friends</p> -->
|
|
|
</div>
|
|
|
<button @click="submit()" :class="(is_form =='1' && is_punch=='1')? 'sub-success':'' " >{{ (is_form =='1' && is_punch=='1') ?'COMPLETE':'SUBMIT' }} </button>
|
|
|
</div>
|
|
@@ -425,7 +446,7 @@ function toCoupons(){
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-else class="popupsecshow-content">
|
|
|
- <img class="popupsecshow-content-img" src="https://cdn.alipearlhair.com/media/wysiwyg/zpage/1689923313.png" alt="">
|
|
|
+ <img class="popupsecshow-content-img" src="https://cdn.alipearlhair.com/media/wysiwyg/zpage/1689923314.png" alt="">
|
|
|
<button @click="toCoupons()" >CHECK NOW</button>
|
|
|
</div>
|
|
|
</div>
|