123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- // components/component-list.js
- const { cosBaseUrl } = require('../../../utils/newServices.js')
- const app = getApp()
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- hasProduct: {
- type: Boolean
- },
- hasPay: {
- type: Boolean
- },
- sceneId: {
- type: String
- },
- thumbUrl: {
- type: String
- },
- imageUrl: {
- type: String
- },
- name: {
- type: String
- },
- pavilionName: {
- type: String
- },
- statusTextDesp: {
- type: String
- },
- distance: {
- type: String
- },
- detailType: {
- type: [Number, String],
- },
- online: Number,
- scenePv: Number,
- link: String
- },
- options: {
- addGlobalClass: true,
- newImg: ''
- },
- lifetimes: {
- attached: function(){
- let that = this
- this.setData({
- newImg: that.getImgUrl()
- })
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- cosBaseUrl
- },
- /**
- * 组件的方法列表
- */
- methods: {
- goBigScene: function(){
- console.log(this.data.detailType, 666)
- if(this.data.detailType == 2){
- wx.navigateTo({
- url: '/pages/guicangDetails/index?id=' + this.data.sceneId
- });
- } else {
- if (this.data.online === 1){
- app.globalData.currentUrl = this.data.link
- wx.navigateTo({
- url: `../../wv_page/index?id=${this.data.sceneId}`,
- success: function (res) { },
- fail: function (res) { },
- complete: function (res) { },
- })
- }else{
- wx.navigateTo({
- url: `/pages/zl_detail/index?id=${this.data.sceneId}`,
- success: function (res) { },
- fail: function (res) { },
- complete: function (res) { },
- })
- }
- }
-
- },
- getImgUrl: function(){
- let url = this.data.thumbUrl || this.data.imageUrl
- return url.includes('http') ? url : (this.data.cosBaseUrl + url)
- }
-
- },
- ready : function(){
- console.log(this.data)
- }
- })
|