PageDesign.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <template>
  2. <view class="pageDesin-box" v-if="temData.length">
  3. <!-- <view class="address-view" @click="openLocation" :style="{ backgroundColor: temData[0].modelData.topBgColor, color:temData[0].modelData.textColor }">
  4. <text class="ibonfont ibondingweiweizhi"></text>
  5. <text class="address-text">{{ location.address || '请手动定位' }}</text>
  6. <text class="ibonfont ibonjinru"></text>
  7. </view> -->
  8. <!-- <view style="position: relative;z-index: 2;"> -->
  9. <block v-for="(item, index) in temData" :key="index">
  10. <ImgSwiper v-if="item.comName === 'ImgSwiper'" :modelData="item.modelData" />
  11. <SearchC v-if="item.comName === 'SearchC'" :modelData="item.modelData" />
  12. <MagicImg v-if="item.comName === 'MagicImg'" :modelData="item.modelData" />
  13. <Notice v-if="item.comName === 'Notice'" :modelData="item.modelData" :noticeData="item.data" />
  14. <NavBar v-if="item.comName === 'NavBar'" :modelData="item.modelData" />
  15. <view class="" v-if="temData[index].comName === 'NavBar' && temData[index+1].comName !== 'NavBar'">
  16. <image src="http://up.liuniukj.com/167307900573324/931544405107da76ca2ec31cd63fae49/yyzq.png" mode=""
  17. class="banner-ad"
  18. @click="navTo('/pagesT/unit/item')"></image>
  19. </view>
  20. <AdvGroup v-if="item.comName === 'AdvGroup'" :modelData="item.modelData" />
  21. <GoodsGroup v-if="item.comName === 'GoodsGroup'" :modelData="item.modelData" :goodsList="item.data"
  22. :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
  23. <LimitedSeckill v-if="item.comName === 'LimitedSeckill'" :modelData="item.modelData" :goodsList="item.data"
  24. :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
  25. <CouponGroup v-if="item.comName === 'CouponGroup'" :modelData="item.modelData" :couponList="item.data" />
  26. <LineF v-if="item.comName === 'LineF'" :modelData="item.modelData" />
  27. <Blank v-if="item.comName === 'Blank'" :modelData="item.modelData" />
  28. <div v-if="item.comName === 'FloatBth'" class="float-bth" @click="btnEvent(item)" :style="{
  29. backgroundColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : 'transparent',
  30. borderColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : '#999999'
  31. }">
  32. <image :src="item.modelData.image" class="float-img" />
  33. </div>
  34. <!-- #ifdef MP-WEIXIN -->
  35. <button v-if="item.comName === 'wxService'" class="float-bth wxService" :style="{
  36. color: item.modelData.color
  37. }" open-type="contact">
  38. <text class="ibonfont ibonkefu"></text>
  39. </button>
  40. <!-- #endif -->
  41. </block>
  42. <!-- <view class="logo-view" v-if="$common.getEnToken() !== '8fa553d53f44e33123e4d0d51a0de634'">
  43. <image src="https://onlineimg.qianniao.vip/QNlogo-i-1.png" mode="aspectFit"></image>
  44. <view class="logo-tip">- 千鸟云商提供技术支持 -</view>
  45. </view> -->
  46. <!-- </view> -->
  47. </view>
  48. </template>
  49. <script>
  50. import SearchC from './components/Search.vue';
  51. import ImgSwiper from './components/Banner.vue';
  52. import MagicImg from './components/MagicImg.vue';
  53. import Notice from './components/Notice.vue';
  54. import NavBar from './components/NavBar.vue';
  55. import GoodsGroup from './components/GoodsGroup.vue';
  56. import LimitedSeckill from './components/LimitedSeckill.vue';
  57. import CouponGroup from './components/CouponGroup.vue';
  58. import LineF from './components/Line.vue';
  59. import Blank from './components/Blank.vue';
  60. import AdvGroup from './components/AdvGroup.vue';
  61. // import NavigationBar from './components/NavigationBar.vue';
  62. export default {
  63. name: 'PageDesign',
  64. components: {
  65. SearchC,
  66. ImgSwiper,
  67. MagicImg,
  68. Notice,
  69. NavBar,
  70. GoodsGroup,
  71. LimitedSeckill,
  72. CouponGroup,
  73. LineF,
  74. Blank,
  75. AdvGroup
  76. // NavigationBar
  77. },
  78. props: {
  79. showGoodsPrice: {
  80. type: [Number, String],
  81. default: ''
  82. },
  83. temData: {
  84. type: Array,
  85. default: () => {
  86. return [];
  87. }
  88. },
  89. pageBack: {
  90. type: Boolean,
  91. default: false
  92. },
  93. isBackIndex: {
  94. type: Boolean,
  95. default: false
  96. },
  97. amapPlugin: {
  98. type: [Object, Function],
  99. default: () => {
  100. return {};
  101. }
  102. },
  103. selAddress: {
  104. type: Object,
  105. default: () => {
  106. return {};
  107. }
  108. }
  109. },
  110. computed: {
  111. style() {
  112. const systemInfo = uni.getSystemInfoSync();
  113. return `padding-top:${systemInfo.statusBarHeight + 50}px`;
  114. },
  115. location() {
  116. return this.$store.state.locationObj;
  117. }
  118. },
  119. data() {
  120. return {
  121. selAddressD: {}
  122. };
  123. },
  124. watch: {
  125. selAddress(val) {
  126. this.selAddressD = val;
  127. }
  128. },
  129. created() {
  130. // console.log(this.$common.getEnToken())
  131. // this.getHome();
  132. },
  133. methods: {
  134. navTo(url) {
  135. // console.log(this.hasLogin)
  136. // return
  137. if (!this.$store.state.hasLogin) {
  138. // #ifdef APP-PLUS
  139. uni.reLaunch({
  140. url: '/pagesT/public/wxLogin'
  141. });
  142. // #endif
  143. // #ifdef MP-WEIXIN
  144. uni.reLaunch({
  145. url: '/pagesT/binding/bindInfo'
  146. });
  147. //#endif
  148. // #ifdef H5
  149. uni.navigateTo({
  150. url: '/pagesT/public/wxLogin?loginType=2'
  151. });
  152. // #endif
  153. } else {
  154. uni.navigateTo({
  155. url
  156. });
  157. }
  158. },
  159. backEvent() {
  160. if (this.isBackIndex) {
  161. this.goPage('/pages/index/index', 'switchTab');
  162. } else {
  163. uni.navigateBack();
  164. }
  165. },
  166. openLocation() {
  167. this.$emit('openLocation');
  168. },
  169. getHome() {
  170. this.$u.api.getHome().then(res => {
  171. uni.stopPullDownRefresh();
  172. this.temData = res.data;
  173. });
  174. },
  175. btnEvent(item) {
  176. if (item.modelData.btnType === 2) {
  177. uni.makePhoneCall({
  178. phoneNumber: item.modelData.phone
  179. });
  180. } else if (item.modelData.btnType === 1) {
  181. this.goPage(item.modelData.url, item.modelData.switchTab);
  182. } else {
  183. uni.pageScrollTo({
  184. scrollTop: 0,
  185. duration: 300
  186. });
  187. }
  188. }
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. .pageDesin-box {
  194. // background-color: #f5f9fc;
  195. // padding-top: calc(44px + var(--status-bar-height));
  196. }
  197. .float-bth {
  198. position: fixed;
  199. bottom: 150upx;
  200. right: 20upx;
  201. width: 80upx;
  202. height: 80upx;
  203. text-align: center;
  204. cursor: pointer;
  205. border-radius: 100%;
  206. border: 1upx solid #999;
  207. box-shadow: 0 6upx 20upx #dcdcdc;
  208. z-index: 99;
  209. .float-img {
  210. width: 40upx;
  211. height: 40upx;
  212. display: inline-block;
  213. margin-top: 20upx;
  214. }
  215. }
  216. .wxService {
  217. padding: 0;
  218. background-color: #ffffff;
  219. border: 0 none;
  220. bottom: 250upx;
  221. line-height: 80upx;
  222. .ibonkefu {
  223. font-size: 46upx;
  224. }
  225. &::after {
  226. border: 0 none;
  227. }
  228. }
  229. .logo-view {
  230. text-align: center;
  231. padding: 10upx 0;
  232. image {
  233. width: 120upx;
  234. height: 20upx;
  235. opacity: 0.7;
  236. }
  237. .logo-tip {
  238. // padding-top: 4upx;
  239. font-size: 18upx;
  240. color: #999;
  241. }
  242. }
  243. .address-view {
  244. padding: 20upx;
  245. font-size: 26upx;
  246. // background-color: #ffffff;
  247. .address-text {
  248. display: inline-block;
  249. vertical-align: middle;
  250. font-weight: bold;
  251. }
  252. .ibonfont {
  253. margin-right: 10upx;
  254. // color: #999;
  255. vertical-align: middle;
  256. }
  257. .ibonjinru {
  258. // color: #333;
  259. font-weight: 300;
  260. font-size: 28upx;
  261. }
  262. }
  263. .banner-ad {
  264. width: 690rpx;
  265. height: 190rpx;
  266. display: block;
  267. margin: 20rpx auto;
  268. }
  269. </style>