banner_body.html 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>手机app通用模板我的积分商城首页页面模板</title>
  6. <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
  7. <meta content="yes" name="apple-mobile-web-app-capable" />
  8. <meta content="black" name="apple-mobile-web-app-status-bar-style" />
  9. <meta content="telephone=no" name="format-detection" />
  10. <link href="../../css/style.css" rel="stylesheet" type="text/css"/>
  11. <link href="../../css/style2.css" rel="stylesheet" type="text/css" />
  12. <link href="../../css/html.css" rel="stylesheet" type="text/css" />
  13. <link rel="stylesheet" href="../../css/styleChoose.css">
  14. <style>
  15. .aui-loan-body {
  16. display: flex;
  17. display: -webkit-flex;
  18. }
  19. .aui-loan-body-item {
  20. width: 50%;
  21. padding-left: 10px;
  22. font-size: 0.9 rem;
  23. color: #fff;
  24. }
  25. .aui-loan-body-item:first-of-type {
  26. text-align: left;
  27. }
  28. .aui-loan-body-item:last-of-type {
  29. text-align: center;
  30. }
  31. .aui-list-theme, .aui-flexView {
  32. overflow: scroll;
  33. }
  34. .right-con li .btn button strong, .subCount dd .btn button strong {
  35. height: 22px;
  36. }
  37. .zmq-input-number {
  38. padding: 2px 0;
  39. width: 20% !important;
  40. }
  41. .aui-input {
  42. width: 13%;
  43. position: absolute;
  44. border: 1px solid #067974;
  45. text-align: center;
  46. padding: 2px 0px;
  47. margin-top: -20px;
  48. margin-left: 60px;
  49. border-radius: 5px;
  50. color: #067974;
  51. }
  52. .aui-list-theme-one .aui-list-theme-item {
  53. width: 100%;
  54. }
  55. .aui-list-img {
  56. width: 35%;
  57. height: 6rem;
  58. }
  59. .aui-list-img img {
  60. width: 100%;
  61. height: 100%;
  62. }
  63. .zmq-my-body {
  64. position: relative;
  65. padding: 0px !important
  66. }
  67. .zmq-my-body .zmq-my-info {
  68. width: 100%;
  69. margin-left: 0px;
  70. }
  71. .aui-btn-addCar {
  72. /*padding: 2px 7px;*/
  73. border-radius: 5px;
  74. /*margin-left: 10px;*/
  75. border: 1px solid #00787B;
  76. padding: 3px 5px;
  77. color: #00787B;
  78. display: inline-table;
  79. font-size: 0.6 rem;
  80. float: right;
  81. }
  82. .zmq-my-userinfo-name {
  83. color: #fff;
  84. }
  85. </style>
  86. </head>
  87. <body>
  88. <section id="app" style="margin-left: 1px;margin-right: 1px">
  89. <div class="zmq-my-body">
  90. <div class="zmq-my-info">
  91. <div class="zmq-my-userinfo" v-cloak>
  92. <div class="zmq-my-userinfo-name">
  93. 活动名称:{{activity.activityName}}
  94. </div>
  95. <div class="zmq-my-userinfo-name">
  96. 参与品牌:{{activity.brand}}
  97. </div>
  98. <div class="zmq-my-userinfo-name">
  99. 活动时间:{{activity.beginDate}} 至 {{activity.endDate}}
  100. </div>
  101. <div class="zmq-my-userinfo-name">
  102. 活动规则:{{activity.description}}
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="aui-flex zmq-margin-top-10 zmq-bg-white">
  109. <div class="aui-flex-box zmq-hot-bg zmq-textAlign-center zmq-text-msg">
  110. 活动商品
  111. </div>
  112. </div>
  113. <!--v-cloak-->
  114. <div class="aui-list-theme aui-list-theme-one" v-cloak>
  115. <a href="javascript:;" class="aui-list-theme-item zmq-flex" v-for="(s,i) in list" style="padding: 5px">
  116. <div class="aui-list-img zmq-hot-img">
  117. <img v-lazy="s.materialDto.imgPath" alt="">
  118. </div>
  119. <div class="aui-list-title" style="width: 65%;padding-left: 0.5rem;">
  120. <h3 class="zmq-text-msg" style="padding-left : 2px;">{{s.materialDto.specs}} {{s.materialDto.pattern}}<em class="zmq-text-font-07 zmq-btn-img zmq-padding-status zmq-text-white" style="border-radius: 8px;float: right">{{s.materialDto.brand}}</em></h3>
  121. <p class="zmq-flex zmq-flex-between zmq-margin-top-5 zmq-width-90">
  122. {{s.materialDto.materialName}}
  123. </p>
  124. <div class="aui-line">
  125. <div class="aui-btn-addCar" v-on:click.stop = "downOrder(i,s.materialDto.agentId)">
  126. 立即下单
  127. </div>
  128. </div>
  129. </div> </a>
  130. </div>
  131. <img v-show="hasData == false" src="../../image/nodata.png" />
  132. <div v-show="upLock == false" class="zmq-text-explain zmq-margin-top-10 zmq-textAlign-center zmq-margin-bottom-10 zmq-block-text zmq-text-font-09">
  133. 已无更多数据
  134. </div>
  135. </section>
  136. </body>
  137. <script src="../../script/api.js" type="text/javascript"></script>
  138. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  139. <script type="text/javascript" src="../../script/vue.js"></script>
  140. <script type="text/javascript" src="../../script/vue-lazyload.js"></script>
  141. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  142. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  143. <script type="text/javascript">
  144. apiready = function() {
  145. var id = api.pageParam.id;
  146. new Vue({
  147. el : '#app',
  148. data : {
  149. list : [],
  150. retariler_id : '',
  151. linkId : id,
  152. // 是否有数据
  153. hasData : true,
  154. // ss : [{},{},{},{},{},{},{},{}]
  155. // 分页
  156. upLock : true,
  157. current : 1,
  158. total : 1,
  159. agentId : '',
  160. // 获取积分商城
  161. getJFListUrl : 'getStoreBannerUrl',
  162. // 兑换商品
  163. exchangeUrl : 'exchangeUrl',
  164. storeInfo : {},
  165. activity : {},
  166. list : [],
  167. // 下单
  168. downOrderUrl : 'downOrderUrl',
  169. // 获取经销商列表
  170. getSupplierUrl : 'getSupplierListUrl',
  171. supplierList : [],
  172. chooseSupplierName : '请先选择一个经销商',
  173. UIActionSelector : [],
  174. },
  175. methods : {
  176. init : function() {
  177. var _this = this;
  178. this.retariler_id = $api.getStorage("retailerid");
  179. this.UIActionSelector = api.require('UIActionSelector');
  180. this.getJFList();
  181. this.getSupplierList();
  182. // this.configHeaderRefush(function() {
  183. // _this.downData = 'down';
  184. // _this.upLock = true;
  185. // _this.current = 1;
  186. // _this.getJFList();
  187. // _this.getSupplierList();
  188. // })
  189. // this.configBottomRefush(function(status) {
  190. // // 开启上拉加载
  191. // if (_this.hasData == true) {
  192. // // 开启上拉加载
  193. // if (_this.total > _this.current) {
  194. // _this.downData = 'up';
  195. // _this.current = _this.current + 1;
  196. // _this.getJFList();
  197. // } else {
  198. // // 上啦没有数据了
  199. // _this.upLock = false;
  200. // }
  201. // }
  202. // })
  203. },
  204. // 获取经销商列表
  205. getSupplierList : function() {
  206. var data = {
  207. retailer_id : this.retariler_id,
  208. url : 'json',
  209. type : 'body'
  210. }, _this = this;
  211. this.$post(this.getSupplierUrl, data, function(ret) {
  212. if (ret.code == 0 || ret.code == '0') {
  213. var list = new Array();
  214. ret.list.map(function(l, i) {
  215. var option = {
  216. name : l.agentDto.agentName,
  217. id : l.agentId
  218. }
  219. list.push(option);
  220. })
  221. _this.supplierList = list;
  222. }
  223. })
  224. },
  225. // 开始下单
  226. downOrder : function(index) {
  227. var _this = this;
  228. // 开始选择经销商
  229. this.chooseRegion(this.UIActionSelector, 1, this.supplierList, function(ret) {
  230. if (ret.eventType == 'ok') {
  231. var r = ret.selectedInfo[0];
  232. _this.addCar(index,r);
  233. }
  234. })
  235. // var data = {
  236. // retailerId : this.retariler_id,
  237. // amount : 1,
  238. // bizCartDtoList : [this.list[index]],
  239. // agentId : aid,
  240. // url : 'json',
  241. // type : 'body',
  242. // }, url = this.downOrderUrl, _this = this;
  243. // this.$post(url, data, function(ret) {
  244. // if (ret.code == 0) {
  245. // _this.showToast("下单成功");
  246. // }
  247. // });
  248. },
  249. addCar : function(index, agent) {
  250. var param = {
  251. shopInfo : this.list[index].materialDto,
  252. type : 'order',
  253. agent : JSON.stringify(agent),
  254. aid : this.activity.id,
  255. agentId : agent.id
  256. }
  257. this.sendEvent("showInfo", param);
  258. },
  259. getJFList : function() {
  260. var data = '?id=' + this.linkId, _this = this;
  261. this.$getadd(this.getJFListUrl, data, function(ret) {
  262. if (ret.code == 0) {
  263. _this.activity = ret.data.activity;
  264. _this.list = ret.data.list;
  265. }
  266. })
  267. },
  268. dh : function(id, p, g, m) {
  269. var _this = this;
  270. var amount = typeof m == 'undefined' ? 1 : m;
  271. this.showModal("兑换提示", "确认用" + (p * amount) + '积分兑换' + amount + '个' + g + '?', ["确认", "取消"], function(index) {
  272. if (index == 1) {
  273. var data = {
  274. retailerId : _this.retariler_id,
  275. totalAmount : amount,
  276. mallId : id,
  277. goodsName : g,
  278. payAmunt : p,
  279. type : 'body',
  280. url : 'json',
  281. }
  282. _this.$post(_this.exchangeUrl, data, function(ret) {
  283. if (ret.code == 0) {
  284. api.toast({
  285. msg : '兑换成功'
  286. });
  287. // 跳转到积分消费列表中
  288. setTimeout(function() {
  289. goWin('jifenGet1_win', 2, '消费记录');
  290. }, 500);
  291. }
  292. })
  293. }
  294. })
  295. }
  296. },
  297. mounted : function() {
  298. this.init();
  299. Vue.use(VueLazyload, {
  300. preLoad : 1.3,
  301. error : '../../image/noimg.png',
  302. loading : '../../image/load.gif',
  303. attempt : 1,
  304. });
  305. }
  306. })
  307. }
  308. function goWin(winName, type, title) {
  309. api.openWin({
  310. name : winName,
  311. url : './' + winName + '.html',
  312. pageParam : {
  313. type : type,
  314. title : title,
  315. page : 'dan'
  316. }
  317. });
  318. }
  319. </script>
  320. </html>