PageDesign.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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="goPage('/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. backEvent() {
  135. if (this.isBackIndex) {
  136. this.goPage('/pages/index/index', 'switchTab');
  137. } else {
  138. uni.navigateBack();
  139. }
  140. },
  141. openLocation() {
  142. this.$emit('openLocation');
  143. },
  144. getHome() {
  145. this.$u.api.getHome().then(res => {
  146. uni.stopPullDownRefresh();
  147. this.temData = res.data;
  148. });
  149. },
  150. btnEvent(item) {
  151. if (item.modelData.btnType === 2) {
  152. uni.makePhoneCall({
  153. phoneNumber: item.modelData.phone
  154. });
  155. } else if (item.modelData.btnType === 1) {
  156. this.goPage(item.modelData.url, item.modelData.switchTab);
  157. } else {
  158. uni.pageScrollTo({
  159. scrollTop: 0,
  160. duration: 300
  161. });
  162. }
  163. }
  164. }
  165. };
  166. </script>
  167. <style lang="scss">
  168. .pageDesin-box {
  169. // background-color: #f5f9fc;
  170. // padding-top: calc(44px + var(--status-bar-height));
  171. }
  172. .float-bth {
  173. position: fixed;
  174. bottom: 150upx;
  175. right: 20upx;
  176. width: 80upx;
  177. height: 80upx;
  178. text-align: center;
  179. cursor: pointer;
  180. border-radius: 100%;
  181. border: 1upx solid #999;
  182. box-shadow: 0 6upx 20upx #dcdcdc;
  183. z-index: 99;
  184. .float-img {
  185. width: 40upx;
  186. height: 40upx;
  187. display: inline-block;
  188. margin-top: 20upx;
  189. }
  190. }
  191. .wxService {
  192. padding: 0;
  193. background-color: #ffffff;
  194. border: 0 none;
  195. bottom: 250upx;
  196. line-height: 80upx;
  197. .ibonkefu {
  198. font-size: 46upx;
  199. }
  200. &::after {
  201. border: 0 none;
  202. }
  203. }
  204. .logo-view {
  205. text-align: center;
  206. padding: 10upx 0;
  207. image {
  208. width: 120upx;
  209. height: 20upx;
  210. opacity: 0.7;
  211. }
  212. .logo-tip {
  213. // padding-top: 4upx;
  214. font-size: 18upx;
  215. color: #999;
  216. }
  217. }
  218. .address-view {
  219. padding: 20upx;
  220. font-size: 26upx;
  221. // background-color: #ffffff;
  222. .address-text {
  223. display: inline-block;
  224. vertical-align: middle;
  225. font-weight: bold;
  226. }
  227. .ibonfont {
  228. margin-right: 10upx;
  229. // color: #999;
  230. vertical-align: middle;
  231. }
  232. .ibonjinru {
  233. // color: #333;
  234. font-weight: 300;
  235. font-size: 28upx;
  236. }
  237. }
  238. .banner-ad {
  239. width: 690rpx;
  240. height: 190rpx;
  241. display: block;
  242. margin: 20rpx auto;
  243. }
  244. </style>