first commit
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-cell-group--inset {
|
||||
margin: 0 16px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.bottom-button {
|
||||
width: 160px;
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar title="地址管理" left-arrow
|
||||
@click-left="location.href = '/mobile/welfare/mine/index'"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div v-if="vLoading && !vLoading.value">
|
||||
<van-address-list
|
||||
v-if="addressList && addressList.length>0 "
|
||||
v-model="chosenAddressId"
|
||||
:list="addressList"
|
||||
default-tag-text="默认"
|
||||
@add="onAdd"
|
||||
@edit="onEdit"
|
||||
></van-address-list>
|
||||
|
||||
<van-empty v-else description="暂无地址">
|
||||
<van-button round type="danger" class="bottom-button" @click="onAdd">新增地址</van-button>
|
||||
</van-empty>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, welfareMixins],
|
||||
data() {
|
||||
return {
|
||||
chosenAddressId: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onAdd() {
|
||||
window.location.href = '/mobile/welfare/mine/addressEdit'
|
||||
},
|
||||
onEdit(item, index) {
|
||||
window.location.href = '/mobile/welfare/mine/addressEdit?id=' + item.id
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.startLoading()
|
||||
await this.selectAddressList()
|
||||
this.closeLoading()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,103 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-cell-group--inset {
|
||||
margin: 0 16px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar title="地址管理" left-arrow placeholder fixed
|
||||
@click-left="location.href = '/mobile/welfare/mine/address'"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div v-if="vLoading && !vLoading.value">
|
||||
<van-address-edit
|
||||
ref="address"
|
||||
:area-list="areaList"
|
||||
:show-delete="addressId"
|
||||
:address-info="addressInfo"
|
||||
show-set-default
|
||||
show-search-result
|
||||
tel-maxlength="11"
|
||||
:area-columns-placeholder="['请选择', '请选择', '请选择']"
|
||||
@save="onSave"
|
||||
@delete="onDelete"
|
||||
></van-address-edit>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/welfare/include/areaList.js"){};include("/mobile/welfare/include/mixins.js"){}#-->
|
||||
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, welfareMixins],
|
||||
data() {
|
||||
return {
|
||||
areaList: areaList,
|
||||
addressInfo: {},
|
||||
addressId: null
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async onSave(content) {
|
||||
const loading = this.$toast.loading({
|
||||
message: '保存中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
content.userName = content.name
|
||||
const resp = await $.post('/mobile/welfare/mine/doSaveUserAddress', content)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.location.href = '/mobile/welfare/mine/address'
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
async onDelete(content) {
|
||||
const loading = this.$toast.loading({
|
||||
message: '删除中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
const resp = await $.post('/mobile/welfare/mine/deleteAddress', {id: content.id})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$toast.success(resp.msg)
|
||||
setTimeout(() => {
|
||||
window.location.href = '/mobile/welfare/mine/address'
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.startLoading()
|
||||
this.addressId = GetQueryString("id") === '' ? null : GetQueryString("id")
|
||||
if (this.addressId) {
|
||||
const resp = await $.get('/mobile/welfare/mine/findOneUserAddress', {id: this.addressId})
|
||||
if (resp.code === 0) {
|
||||
this.addressInfo = resp.data
|
||||
}
|
||||
this.closeLoading()
|
||||
} else {
|
||||
this.addressInfo.name = "${@shiro.getPrincipalProperty('username')}";
|
||||
this.closeLoading()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,65 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-cell-group--inset {
|
||||
margin: 0 16px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar title="个人信息" left-arrow placeholder fixed
|
||||
@click-left="history.back()"></van-nav-bar>
|
||||
</van-sticky>
|
||||
<div class="mt10" v-if="vLoading && !vLoading.value">
|
||||
<van-cell-group class="van-cell-group--inset">
|
||||
<van-cell>
|
||||
<template #title>
|
||||
<div style="font-weight: bold;font-size: 15px">个人信息</div>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell :border="false" is-link title="我的福利" url="/mobile/welfare/mine/myWelfare">
|
||||
<template #icon>
|
||||
<van-icon class="van-cell__left-icon" color="red" name="star"></van-icon>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell :border="false" is-link title="我的地址" url="/mobile/welfare/mine/address">
|
||||
<template #icon>
|
||||
<van-icon class="van-cell__left-icon" color="red" name="location"></van-icon>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell :border="false" is-link title="我的签名" url="/mobile/welfare/mine/sign">
|
||||
<template #icon>
|
||||
<van-icon class="van-cell__left-icon" color="red" name="coupon"></van-icon>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</div>
|
||||
|
||||
<!--#include("/mobile/welfare/include/tarbar.html"){}#-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, welfareMixins],
|
||||
data() {
|
||||
return {
|
||||
tarBarActive: 1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.startLoading()
|
||||
this.closeLoading()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,125 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
#app {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
#signature {
|
||||
height: calc(100vh - 136px);
|
||||
background: #fff;
|
||||
border: 1px dashed grey;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.button-operation {
|
||||
display: flex;
|
||||
height: 50px;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.button-operation > div {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.button-operation > div > button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar title="我的签名" left-arrow
|
||||
@click-left="location.href = '/mobile/welfare/mine/index'"></van-nav-bar>
|
||||
</van-sticky>
|
||||
<div id="signature"></div>
|
||||
<div class="button-operation">
|
||||
<div>
|
||||
<van-button type="danger" @click="reset">重写</van-button>
|
||||
</div>
|
||||
<div>
|
||||
<van-button type="info" @click="save">保存</van-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins, welfareMixins],
|
||||
data() {
|
||||
return {
|
||||
userSign: {
|
||||
data: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset() {
|
||||
const val = $('#signature').jSignature("getData", "default")
|
||||
$('#signature').jSignature('clear')
|
||||
this.userSign.data = null
|
||||
},
|
||||
async save() {
|
||||
const slength = $("#signature").jSignature('getData', 'native').length
|
||||
if (slength === 0 && !this.userSign.data) {
|
||||
this.$toast('请先签字!')
|
||||
return
|
||||
}
|
||||
|
||||
const loading = this.$toast.loading({
|
||||
message: '保存中...',
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.userSign.data = $('#signature').jSignature("getData", "default")
|
||||
const resp = await $.post('/mobile/welfare/mine/saveMySignature', this.userSign)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.userSign = resp.data
|
||||
this.$toast.success('保存成功!')
|
||||
}
|
||||
},
|
||||
async getSignature() {
|
||||
const resp = await $.get('/mobile/welfare/mine/getMySignature')
|
||||
if (resp.code === 0) {
|
||||
this.userSign = resp.data
|
||||
if (this.userSign.data) {
|
||||
$('#signature').jSignature("setData", resp.data.data)
|
||||
// $('#signature').jSignature("importData", resp.data.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
$('#signature').jSignature({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
lineWidth: 1
|
||||
})
|
||||
document.body.addEventListener('touchmove', function (e) {
|
||||
e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
|
||||
}, {passive: false}); //passive 参数不能省略,用来兼容ios和android
|
||||
},
|
||||
created() {
|
||||
this.getSignature()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user