天府星
This commit is contained in:
		@@ -283,7 +283,7 @@ import { mapActions, mapState } from 'vuex'
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
 @click="preview(item.accessUrl)"
 | 
			
		||||
      toAddress () {
 | 
			
		||||
        wx.openLocation({
 | 
			
		||||
          latitude: this.info.lat,
 | 
			
		||||
 
 | 
			
		||||
@@ -31,13 +31,14 @@
 | 
			
		||||
      <div class="section yh">
 | 
			
		||||
        <h2>商家优惠</h2>
 | 
			
		||||
        <div class="yh-list">
 | 
			
		||||
          <div class="yh-item" v-for="(item, index) in 4" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail')">
 | 
			
		||||
            <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png" />
 | 
			
		||||
          <div class="yh-item" v-for="(item, index) in list" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail?id=' + item.id)">
 | 
			
		||||
            <image :src="item.userAvatarUrl || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png'" />
 | 
			
		||||
            <div class="right">
 | 
			
		||||
              <h2>实惠超市</h2>
 | 
			
		||||
              <p>Lv.1会员进店享受9折优惠</p>
 | 
			
		||||
              <h2>{{ item.merchantName }}</h2>
 | 
			
		||||
              <p>{{ item.title }}</p>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <AiEmpty v-if="!list.length"></AiEmpty>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="more" @click="$linkTo('./Store')" hover-class="text-hover">查看更多优惠</div>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -99,10 +100,31 @@
 | 
			
		||||
      } else {
 | 
			
		||||
        this.getUserInfo()
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      ...mapActions(['autoLogin', 'getUserInfo'])
 | 
			
		||||
      ...mapActions(['autoLogin', 'getUserInfo']),
 | 
			
		||||
 | 
			
		||||
      getList () {
 | 
			
		||||
        this.$instance.post(`/api/appmerchantinfo/discountList`, null, {
 | 
			
		||||
          withoutToken: true,
 | 
			
		||||
          params: {
 | 
			
		||||
            current: 1,
 | 
			
		||||
            size: 4,
 | 
			
		||||
            status: 1
 | 
			
		||||
          }
 | 
			
		||||
        }).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.list = res.data.records
 | 
			
		||||
            this.isMore = true
 | 
			
		||||
          } else {
 | 
			
		||||
            this.isMore = true
 | 
			
		||||
          }
 | 
			
		||||
        }).catch(() => {
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -31,9 +31,9 @@
 | 
			
		||||
      <AiEmpty v-if="!list.length"></AiEmpty>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="btn-wrapper">
 | 
			
		||||
      <div class="top">
 | 
			
		||||
        <i v-show="!isChoose" @click="isChoose = !isChoose"></i>
 | 
			
		||||
        <image class="bg-img" @click="isChoose = !isChoose" v-show="isChoose" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/Selected.png" />
 | 
			
		||||
      <div class="top" @click="isChoose = !isChoose">
 | 
			
		||||
        <i v-show="!isChoose"></i>
 | 
			
		||||
        <image class="bg-img" v-show="isChoose" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/Selected.png" />
 | 
			
		||||
        <span>同意将上传的内容公开分享到文明广场</span>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="btn" @click="upload" hover-class="text-hover">拍照上传</div>
 | 
			
		||||
@@ -146,6 +146,7 @@
 | 
			
		||||
                this.$instance.post(`/api/appwechatescalation/addOrUpdate`, {
 | 
			
		||||
                  type: 0,
 | 
			
		||||
                  listType: 0,
 | 
			
		||||
                  openStatus: this.isChoose ? 1 : 0,
 | 
			
		||||
                  openId: this.user.openId,
 | 
			
		||||
                  accessUrl: this.imgList[0]
 | 
			
		||||
                }).then(res => {
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
      <div class="status-bar" :style="{height: statusBarHeight + 'px'}"></div>
 | 
			
		||||
      <div class="nav-bar">
 | 
			
		||||
        <image src="/static/img/left.png" @click="back"/>
 | 
			
		||||
        <h2>海报接力</h2>
 | 
			
		||||
        <h2>文明榜单</h2>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="back-wrapper" @click="back" v-show="!isFixed" :style="{marginTop : statusBarHeight + 'px'}">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,91 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="Store">
 | 
			
		||||
    <div class="store-list">
 | 
			
		||||
      <div class="store-item" v-for="(item, index) in 4" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail')">
 | 
			
		||||
        <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png" />
 | 
			
		||||
      <div class="store-item" v-for="(item, index) in list" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail?id=' + item.id)">
 | 
			
		||||
        <image :src="item.userAvatarUrl || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png'" />
 | 
			
		||||
        <div class="middle">
 | 
			
		||||
          <h2>实惠超市</h2>
 | 
			
		||||
          <p>Lv.1会员进店享受9折优惠</p>
 | 
			
		||||
          <h2>{{ item.merchantName }}</h2>
 | 
			
		||||
          <p>{{ item.title }}</p>
 | 
			
		||||
        </div>
 | 
			
		||||
        <image class="right" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/ContentRightArrow@2x.png" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <AiEmpty v-if="!list.length"></AiEmpty>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  import { mapActions, mapState } from 'vuex'
 | 
			
		||||
  export default {
 | 
			
		||||
    appName: '商家优惠',
 | 
			
		||||
    name: 'Store',
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        current: 1,
 | 
			
		||||
        list: [],
 | 
			
		||||
        isMore: false,
 | 
			
		||||
        isFixed: false,
 | 
			
		||||
        statusBarHeight: 20,
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    computed: {
 | 
			
		||||
      ...mapState(['user', 'token'])
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onLoad () {
 | 
			
		||||
      this.getList()
 | 
			
		||||
 | 
			
		||||
      if (!this.token) {
 | 
			
		||||
        this.autoLogin()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.getUserInfo()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      ...mapActions(['autoLogin', 'getUserInfo']),
 | 
			
		||||
 | 
			
		||||
      getList () {
 | 
			
		||||
        if (this.isMore) return
 | 
			
		||||
 | 
			
		||||
        this.$loading()
 | 
			
		||||
        this.$instance.post(`/api/appmerchantinfo/discountList`, null, {
 | 
			
		||||
          withoutToken: true,
 | 
			
		||||
          params: {
 | 
			
		||||
            current: this.current,
 | 
			
		||||
            size: 10,
 | 
			
		||||
            status: 1
 | 
			
		||||
          }
 | 
			
		||||
        }).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.$hideLoading()
 | 
			
		||||
            if (this.current > 1) {
 | 
			
		||||
              this.list = [...this.list, ...res.data.records]
 | 
			
		||||
            } else {
 | 
			
		||||
              this.list = res.data.records
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (res.data.records.length < 10) {
 | 
			
		||||
              this.isMore = true
 | 
			
		||||
 | 
			
		||||
              return false
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.current = this.current + 1
 | 
			
		||||
          } else {
 | 
			
		||||
            this.isMore = true
 | 
			
		||||
          }
 | 
			
		||||
        }).catch(() => {
 | 
			
		||||
          this.$hideLoading()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onReachBottom () {
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="StoreDetail">
 | 
			
		||||
  <div class="StoreDetail" v-if="pageShow">
 | 
			
		||||
    <div class="header" :class="[isFixed ? 'header-active' : '']">
 | 
			
		||||
      <div class="status-bar" :style="{height: statusBarHeight + 'px'}"></div>
 | 
			
		||||
      <div class="nav-bar">
 | 
			
		||||
@@ -10,22 +10,20 @@
 | 
			
		||||
    <div class="back-wrapper" @click="back" v-show="!isFixed" :style="{marginTop : statusBarHeight + 'px'}">
 | 
			
		||||
      <image src="/static/img/left.png"/>
 | 
			
		||||
    </div>
 | 
			
		||||
    <image class="banner" src="https://jisheng-xiaochengxu.oss-cn-hangzhou.aliyuncs.com/admin/5bad9165-fa6e-4c81-894d-2beae426260b.png" />
 | 
			
		||||
    <image class="banner" :src="info.merchantPhoto || 'https://jisheng-xiaochengxu.oss-cn-hangzhou.aliyuncs.com/admin/5bad9165-fa6e-4c81-894d-2beae426260b.png'" />
 | 
			
		||||
    <div class="wrapper">
 | 
			
		||||
      <div class="top">
 | 
			
		||||
        <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png" />
 | 
			
		||||
        <image :src="info.merchantInfo.photoUrl" />
 | 
			
		||||
        <div class="top-right">
 | 
			
		||||
          <h2>商户名称名称名称</h2>
 | 
			
		||||
          <p>成都市金牛区xxxx大厦成都成都成都成都…</p>
 | 
			
		||||
          <h2>{{ info.merchantInfo.merchantName }}</h2>
 | 
			
		||||
          <p @click="toAddress">{{ info.merchantInfo.address }}</p>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="detail">
 | 
			
		||||
        <h2>优惠详情</h2>
 | 
			
		||||
        <div class="detail-content">
 | 
			
		||||
          <h3>Lv.1会员进店享受9折优惠</h3>
 | 
			
		||||
          <p>需要将 input 组件 type 的值设置为 nickname,当用户在此 input 进行输入时,键盘上方会展示微信昵称。
 | 
			
		||||
从基础库2.24.4版本起,在onBlur 事件触发时,微信将异步对用户输入的内容进行安全监测,若未通过安全监测,微信将清空用户输入的内容,
 | 
			
		||||
建议开发者通过 form 中form-type 为submit 的button 组件收集用户输入的内容。</p>
 | 
			
		||||
          <h3>{{ info.title }}</h3>
 | 
			
		||||
          <p>{{ info.content }}</p>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@@ -42,17 +40,21 @@
 | 
			
		||||
      return {
 | 
			
		||||
        isFixed: false,
 | 
			
		||||
        statusBarHeight: 20,
 | 
			
		||||
        list: [],
 | 
			
		||||
        hideStatus: false,
 | 
			
		||||
        pageShow: false,
 | 
			
		||||
        current: 1,
 | 
			
		||||
        isMore: false,
 | 
			
		||||
        isChoose: true
 | 
			
		||||
        info: {}
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onLoad () {
 | 
			
		||||
    onShow () {
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onLoad (query) {
 | 
			
		||||
      this.id = query.id
 | 
			
		||||
      this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
 | 
			
		||||
 | 
			
		||||
      this.$loading()
 | 
			
		||||
      this.getInfo(query.id)
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
      back () {
 | 
			
		||||
@@ -61,6 +63,27 @@
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      toAddress () {
 | 
			
		||||
        uni.openLocation({
 | 
			
		||||
          latitude: this.info.merchantInfo.lat,
 | 
			
		||||
          longitude: this.info.merchantInfo.lng,
 | 
			
		||||
          scale: 18
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      getInfo (id) {
 | 
			
		||||
        this.$loading()
 | 
			
		||||
        this.$instance.post(`/api/appmerchantinfo/queryDiscountDetailById?id=${id}`).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.info = res.data
 | 
			
		||||
 | 
			
		||||
            this.$nextTick(() => {
 | 
			
		||||
              this.pageShow = true
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      preview (url) {
 | 
			
		||||
        let imgs = this.list.map(v => v.accessUrl)
 | 
			
		||||
 | 
			
		||||
@@ -73,7 +96,7 @@
 | 
			
		||||
 | 
			
		||||
    onPageScroll (params) {
 | 
			
		||||
      this.isFixed = params.scrollTop > 60
 | 
			
		||||
    },
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@@ -103,6 +126,10 @@
 | 
			
		||||
        box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
 | 
			
		||||
        border-radius: 16px;
 | 
			
		||||
 | 
			
		||||
        .top-right {
 | 
			
		||||
          flex: 1;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        image {
 | 
			
		||||
          width: 112px;
 | 
			
		||||
          height: 112px;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,101 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="AppSquare">
 | 
			
		||||
    <div class="item" v-for="(item, index) in 10" :key="index">
 | 
			
		||||
      <image src="https://jisheng-xiaochengxu.oss-cn-hangzhou.aliyuncs.com/admin/5bad9165-fa6e-4c81-894d-2beae426260b.png" />
 | 
			
		||||
    <div class="item" v-for="(item, index) in list" :key="index">
 | 
			
		||||
      <image :src="item.accessUrl" mode="aspectFill" @click="preview(item.accessUrl)" />
 | 
			
		||||
      <div class="item-bottom">
 | 
			
		||||
        <div class="left">
 | 
			
		||||
          <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png" />
 | 
			
		||||
          <span>张三</span>
 | 
			
		||||
          <span>{{ item.userName }}</span>
 | 
			
		||||
        </div>
 | 
			
		||||
        <p>2022-11-05 17:45</p>
 | 
			
		||||
        <p>{{ item.createTime }}</p>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  import { mapActions, mapState } from 'vuex'
 | 
			
		||||
 | 
			
		||||
  export default {
 | 
			
		||||
    appName: '文明广场',
 | 
			
		||||
    name: 'AppSquare',
 | 
			
		||||
 | 
			
		||||
    data () {
 | 
			
		||||
      return {
 | 
			
		||||
        current: 1,
 | 
			
		||||
        list: [],
 | 
			
		||||
        isMore: false,
 | 
			
		||||
        isFixed: false,
 | 
			
		||||
        statusBarHeight: 20,
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    computed: {
 | 
			
		||||
      ...mapState(['user', 'token'])
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onLoad () {
 | 
			
		||||
      this.getList()
 | 
			
		||||
 | 
			
		||||
      if (!this.token) {
 | 
			
		||||
        this.autoLogin()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.getUserInfo()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    methods: {
 | 
			
		||||
      ...mapActions(['autoLogin', 'getUserInfo']),
 | 
			
		||||
 | 
			
		||||
      preview (url) {
 | 
			
		||||
        let imgs = this.list.map(v => v.accessUrl)
 | 
			
		||||
 | 
			
		||||
        uni.previewImage({
 | 
			
		||||
          urls: imgs,
 | 
			
		||||
          current: url
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      getList () {
 | 
			
		||||
        if (this.isMore) return
 | 
			
		||||
 | 
			
		||||
        this.$loading()
 | 
			
		||||
        this.$instance.post(`/api/appwechatescalation/list`, null, {
 | 
			
		||||
          params: {
 | 
			
		||||
            current: this.current,
 | 
			
		||||
            size: 10,
 | 
			
		||||
            status: 1,
 | 
			
		||||
            openStatus: 1,
 | 
			
		||||
            listType: 0
 | 
			
		||||
          }
 | 
			
		||||
        }).then(res => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.$hideLoading()
 | 
			
		||||
            if (this.current > 1) {
 | 
			
		||||
              this.list = [...this.list, ...res.data.records]
 | 
			
		||||
            } else {
 | 
			
		||||
              this.list = res.data.records
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (res.data.records.length < 10) {
 | 
			
		||||
              this.isMore = true
 | 
			
		||||
 | 
			
		||||
              return false
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            this.current = this.current + 1
 | 
			
		||||
          } else {
 | 
			
		||||
            this.isMore = true
 | 
			
		||||
          }
 | 
			
		||||
        }).catch(() => {
 | 
			
		||||
          this.$hideLoading()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    onReachBottom () {
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user