PageDesign.vue 6.0 KB

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