| | |
| | | origin: '', |
| | | isFold: false, |
| | | info: {}, |
| | | isCollection: false, |
| | | member: {}, |
| | | showShare: false, |
| | | options: { |
| | |
| | | }, |
| | | handleAction(e) { |
| | | const actionType = e.currentTarget.dataset.code |
| | | const { |
| | | info, member |
| | | let { |
| | | info, member, isCollection |
| | | } = this.data |
| | | if (!member.phone) { |
| | | return wx.navigateTo({ |
| | |
| | | id: this.data.info.id |
| | | }).then(res => { |
| | | info.isCollection = !info.isCollection |
| | | isCollection = !isCollection |
| | | this.setData({ |
| | | info |
| | | isCollection |
| | | }) |
| | | wx.showToast({ |
| | | title: actionType == 'collect' ? '收藏成功' : '取消收藏', |
| | |
| | | salesId: userId || null |
| | | }).then(res => { |
| | | this.setData({ |
| | | info: res.data |
| | | info: res.data, |
| | | isCollection: res.data.isCollection |
| | | }) |
| | | wx.setNavigationBarTitle({ |
| | | title: res.data.title |
| | |
| | | <view class="spaceList"> |
| | | <view class="item" wx:for="{{ info.spaceList }}"> |
| | | <!-- <view class="name">{{ item.spaceName }}</view> --> |
| | | <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> |
| | | <!-- <mp-html content="{{item.spaceContent}}"></mp-html> --> |
| | | <!-- <image data-url="{{ item.spaceImg }}" bindtap="priviewSpace" src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> --> |
| | | <mp-html content="{{item.spaceContent}}"></mp-html> |
| | | </view> |
| | | </view> |
| | | <!-- footer --> |
| | |
| | | </view> |
| | | <view wx:else class="footer" style="padding-bottom: {{bottomLift}}px;"> |
| | | <view class="btns"> |
| | | <button hover-class="none" data-code="{{ info.isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn"> |
| | | <image wx:if="{{ info.isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <button hover-class="none" data-code="{{ isCollection ? 'collect_cancel' : 'collect' }}" bindtap="handleAction" class="item btn"> |
| | | <image wx:if="{{ isCollection }}" class="icon" src="../../static/icon/detail_nav_collected.png" mode="widthFix"></image> |
| | | <image wx:else class="icon" src="../../static/icon/detail_nav_collect.png" mode="widthFix"></image> |
| | | <view class="name">收藏</view> |
| | | </button> |
| | |
| | | windowHeight: windowInfo.windowHeight |
| | | }) |
| | | }) |
| | | }, 2000) |
| | | }, 3000) |
| | | }, |
| | | onShow() { |
| | | const member = wx.getStorageSync('member') |
| | |
| | | current: 0, |
| | | id: '', |
| | | info: {}, |
| | | spaceList: [], |
| | | member: {}, |
| | | showShare: false, |
| | | isFold: false, |
| | |
| | | this.setData({ current: e.detail.current }) |
| | | }, |
| | | priviewSpace(e) { |
| | | return |
| | | const url = e.currentTarget.dataset.url |
| | | const { |
| | | info |
| | |
| | | }).then(res => { |
| | | const index = enjoyList.findIndex( i =>(res.data && i.id === res.data.id) ) |
| | | this.setData({ |
| | | spaceList: res.data.spaceList || [], |
| | | info: { |
| | | ...res.data, |
| | | isEnjoy: index > -1 |
| | |
| | | <mp-html content="{{info.content}}"></mp-html> |
| | | </view> |
| | | <view class="spaceList"> |
| | | <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ info.spaceList }}"> |
| | | <view data-url="{{ item.spaceImg }}" bindtap="priviewSpace" class="item" wx:for="{{ spaceList }}"> |
| | | <!-- <view class="name">{{ item.spaceName }}</view> --> |
| | | <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> |
| | | <!-- <mp-html content="{{item.spaceContent}}"></mp-html> --> |
| | | <!-- <image src="{{ item.spaceImg }}" mode="widthFix" class="img"></image> --> |
| | | <mp-html content="{{item.spaceContent}}"></mp-html> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | import { getDictData, getMemberInfo } from '../../api/index' |
| | | import { |
| | | getDictData, |
| | | getMemberInfo |
| | | } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | topimg:'', |
| | | topimg: '', |
| | | clientHeight: 0, |
| | | clientTop: 0, |
| | | clientTop: 0, |
| | | showCard: false, |
| | | userInfo: {name:''} |
| | | userInfo: { |
| | | name: '' |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | const res = wx.getMenuButtonBoundingClientRect() |
| | | this.setData({clientHeight: res.height}) |
| | | this.setData({clientTop: res.top}) |
| | | this.setData({ |
| | | clientHeight: res.height |
| | | }) |
| | | this.setData({ |
| | | clientTop: res.top |
| | | }) |
| | | }, |
| | | onShow() { |
| | | this.initData() |
| | | }, |
| | | subscribeMessage: function () { |
| | | // 显示加载提示 |
| | | // 调用订阅消息的API |
| | | wx.requestSubscribeMessage({ |
| | | tmplIds: ['A_jEWoyl0Uu_l5J-zwlwx_FcbUirlsS6Peu4JW6a7Gc'], |
| | | success: (res) => { |
| | | console.log('res', res); |
| | | }, |
| | | fail: () => { |
| | | reject(); |
| | | } |
| | | }) |
| | | }, |
| | | showQrcode() { |
| | | this.setData({ showCard: true }) |
| | | this.setData({ |
| | | showCard: true |
| | | }) |
| | | }, |
| | | onClose() { |
| | | this.setData({ showCard: false }) |
| | | this.setData({ |
| | | showCard: false |
| | | }) |
| | | }, |
| | | changePath(e) { |
| | | const {userInfo} = this.data |
| | | const { |
| | | userInfo |
| | | } = this.data |
| | | // 页面跳转 |
| | | let temp = [ |
| | | '/pages/userinfo/index', |
| | | '/pages/store/staff?userType=1', |
| | | '/pages/userinfo/collect', |
| | | '/pages/store/index?shopId='+userInfo.departmentId, |
| | | '/pages/store/index?shopId=' + userInfo.departmentId, |
| | | '/pages/sets/index' |
| | | ] |
| | | const index = e.currentTarget.dataset.index |
| | |
| | | getMemberInfo().then(res => { |
| | | this.setData({ |
| | | userInfo: res.data |
| | | }) |
| | | wx.setStorageSync('member',res.data) |
| | | }) |
| | | }) |
| | | wx.setStorageSync('member', res.data) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'STAFF_WORK_TOP_IMG' |
| | | }).then(res => { |
| | | this.setData({ topimg: res.data.code }) |
| | | this.setData({ |
| | | topimg: res.data.code |
| | | }) |
| | | }) |
| | | }, |
| | | onReady() { |
| | | }, |
| | | onReady() {}, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | |
| | | <image class="icon" src="../../static/icon/mine_ic_ar.png" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | <!-- index.wxml --> |
| | | <button bindtap="subscribeMessage">订阅消息</button> |
| | | </view> |
| | | <!-- 详情 --> |
| | | <van-popup show="{{ showCard }}" closeable round bind:close="onClose"> |
| | |
| | | }, |
| | | { |
| | | "name": "", |
| | | "pathName": "pages/productVideo/index", |
| | | "query": "id=1813372914895843329", |
| | | "pathName": "pages/detailDis/product", |
| | | "query": "id=1823671456940113921", |
| | | "launchMode": "default", |
| | | "scene": null |
| | | }, |