123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <template>
- <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
- <tm-menubars title="地址列表" :shadow="0" :showback="true"></tm-menubars>
- <div class="dizhi">
- <view class="contdz pt-20" v-for="item in addList" :key="item.id">
- <view>
- <text> {{item.name}}</text>
- <text class="ml-40 text-gray text-size-m">{{item.mobile}}</text>
- <tm-button class="ml-50" :round="10" theme="gray" size="s" v-if="item.label">{{item.label}}</tm-button>
- <tm-button class="ml-10" :round="10" size="s" v-if="item.default_address==1">默认</tm-button>
- </view>
- <view class="text-gray text-size-s mt-15">
- <text>{{item.region}} {{item.address}}</text>
- <image class="fr xiugai" src="/static/img/109.png" mode="widthFix" @click="goRedact(item)"></image>
- </view>
- </view>
- </div>
- <tm-button :round="24" class="sao mb-40 mt-40" block @click="xinjian">新建收获地址</tm-button>
- <!-- 弹出层消息 -->
- <tm-message ref="toast"></tm-message>
- </view>
- </template>
- <script>
- import {
- myRequest
- } from '@/api/request.js'
- export default {
- data() {
- return {
- checked1: false,
- checked2: false,
- checked3: false,
- beizu: '',
- addList: []
- };
- },
- onLoad() {
- },
- created() {
- var that = this;
- setTimeout(function() {
- if (uni.getStorageSync("token") == "") {
- uni.redirectTo({
- url: "/pages/login/index"
- })
- }
- }, 1000)
- this.sys = uni.getSystemInfoSync();
- this.getAddList();
- },
- methods: {
- xinjian() {
- uni.navigateTo({
- url: "/pages/shouhuodi/index",
- })
- },
- // 获取地址列表
- getAddList() {
- let that = this;
- myRequest({
- url: '/api/Address/addressList',
- method: 'get',
- data: that.reqData
- }).then(res => {
- console.log(res.data);
- if (res.data.code == 200) {
- that.addList = res.data.data;
- } else {
- that.$refs.toast.show({
- model: 'error',
- label: res.data.msg
- })
- }
- })
- },
- // 编辑地址
- goRedact(item) {
- uni.navigateTo({
- // url: '/pages/shouhuodi/index?data='+data
- url: '/pages/shouhuodi/index?id='+item.id
- })
- }
- },
- }
- </script>
- <style lang="scss">
- /deep/ .tm-menubars .body {
- background-color: #1b1b1b !important;
- }
- /deep/ .zhuti {
- padding: 10px 10px;
- }
- /deep/ .kuang {
- margin: 0 !important;
- padding: 0px !important;
- }
- .sao {
- width: 88%;
- margin: 0 auto;
- margin-top: 30px;
- }
- .dizhi {
- background: #1B1B1B;
- }
- .xiugai {
- width: 18px;
- height: 18px;
- }
- .contdz {
- width: 90%;
- margin: 0 auto;
- border-bottom: 1px solid #303030;
- padding-bottom: 15px;
- }
- </style>
|