detail.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <extend name="public/base" />
  2. <block name="title">
  3. <title>{$seo.title|default=$site_info.site_name.' - 兑换商品'}</title>
  4. </block>
  5. <block name="main">
  6. <div class="wrap">
  7. <div class="virtualProduct_xiangqing">
  8. <div class="shadowScroll">
  9. <input type="hidden" name="goodsId" value="{$goods.goods_id}">
  10. <div class="realProduct_main">
  11. <div class="rpxq">
  12. <div class="rpxq_img"><img src="{$goods.original_img}" /></div>
  13. <div class="rpxq_text">
  14. <h4 class="rpxq_text__h4">{$goods.goods_name}</h4>
  15. <p class="rpxq_text__p">所需积分:<span class="bColor">{$goods.integral}积分</span></p>
  16. <if condition="empty($order.order_id)">
  17. <p class="rpxq_text__p">剩余个数:{$goods.remain_cnt}</p>
  18. </if>
  19. <!--<div id="exchange" class="rpxq_btn" >-->
  20. <!--<if condition="!empty($order_id)">-->
  21. <!--<img src="__STATIC__/h5wap/images/button_duihuan_lingjiang.png" alt="">-->
  22. <!--<else/>-->
  23. <!--<img src="__STATIC__/h5wap/images/button_duihuan.png" alt="">-->
  24. <!--</if>-->
  25. <!--</div>-->
  26. <!-- 虚拟物品 -->
  27. <if condition="$goods.is_real eq 1">
  28. <p class="realProduct_bottom">
  29. <button id="exchange" class="realProduct_bottom__btn">
  30. <if condition="!empty($order.order_id)">
  31. <!--领奖-->
  32. <img src="__STATIC__/h5wap/images/button_duihuan_lingjiang.png" alt="">
  33. <else/>
  34. <!--兑换123-->
  35. <img src="__STATIC__/h5wap/images/button_duihuan.png" alt="">
  36. </if>
  37. </button>
  38. </p>
  39. <else/>
  40. <p class="realProduct_bottom">
  41. <button id="exchange" class="realProduct_bottom__btn">
  42. <if condition="!empty($order.order_id)">
  43. <!--领奖-->
  44. <img src="__STATIC__/h5wap/images/button_duihuan_lingjiang.png" alt="">
  45. <else/>
  46. <!--兑换456-->
  47. <img src="__STATIC__/h5wap/images/button_duihuan.png" alt="">
  48. </if>
  49. </button>
  50. </p>
  51. </if>
  52. </div>
  53. </div>
  54. <if condition="$goods.is_real eq 2">
  55. <p class="shangpin_title">寄送信息</p>
  56. <div class="form">
  57. <p class="form_name">姓名:<input name="consignee" class="form_name__input form_black__input" type="text" /></p>
  58. <p class="form_phone">手机:<input name="mobile" class="form_phone__input form_black__input" type="text" /></p>
  59. <p class="form_send">送至:
  60. <span class="form_send__select">请选择地区</span>
  61. </p>
  62. <p class="form_address">
  63. <input type="hidden" name="country" value="0">
  64. <input type="hidden" name="province">
  65. <input type="hidden" name="city">
  66. <input type="hidden" name="district">
  67. <input type="hidden" name="town">
  68. <input class="form_address__input form_black__input" name="address" type="text" placeholder="详细地址"/>
  69. </p>
  70. <!--<p class="form_address">-->
  71. <!--<button id="exchange" class="realProduct_bottom__btn"><if condition="!empty($order_id)">领奖<else/>兑换</if></button>-->
  72. <!--</p>-->
  73. </div>
  74. </if>
  75. <p class="shangpin_title">商品详情</p>
  76. <div class="shangpin_picture">
  77. {$goods.goods_content}
  78. </div>
  79. <!--<p class="shangpin_title">使用说明</p>-->
  80. <!--<div class="shangpin_picture">-->
  81. <!--领取礼包成功后,将自动发放到游戏内,请登录游戏查看!-->
  82. <!--</div>-->
  83. <!--<p class="shangpin_title">有效期</p>-->
  84. <!--<div class="shangpin_picture">-->
  85. <!--2018-02-15至2018-04-01-->
  86. <!--</div>-->
  87. </div>
  88. </div>
  89. <div class="return-group">
  90. <button class="btn-primary" returntolist>返回列表</button>
  91. </div>
  92. <div class="duihuanSucess duihuanSucess_v">兑换成功</div>
  93. </div>
  94. <div class="duihuanShadow">
  95. <div class="duihuanShadow_box">
  96. <p class="duihuanShadow_box__p1">提示信息</p>
  97. <p class="duihuanShadow_box__p2">是否<if condition="!empty($order_id)">领取<else/>兑换</if>该礼包?</p>
  98. <p class="duihuanShadow_box__p3">
  99. <span class="duihuan_cancel duihuan_cancel_v">取消</span>
  100. <span class="duihuan_queren duihuan_queren_v">确认</span>
  101. </p>
  102. </div>
  103. </div>
  104. <div class="address_pop">
  105. <div class="address_mask"></div>
  106. <div class="address_content">
  107. <h4 class="address_head">
  108. 所在地区
  109. <a href="javascript:;" class="address_close" onclick="$('.address_pop').hide()"></a>
  110. </h4>
  111. <div class="address_body">
  112. <div class="address_tab">
  113. </div>
  114. <div class="address_list">
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </block>
  121. <block name="otherScript">
  122. <script>
  123. $('.form_send__select').on('click', huoAddressInit)
  124. var goodsId
  125. var consignee
  126. var mobile
  127. var country
  128. var province
  129. var city
  130. var district
  131. var town
  132. var address
  133. $('#exchange').click(function () {
  134. goodsId = $('[name="goodsId"]').val()
  135. if ('{$goods.is_real}' == 2) {
  136. consignee = $('[name="consignee"]').val().trim()
  137. mobile = $('[name="mobile"]').val().trim()
  138. country = $('[name="country"]').val()
  139. province = $('[name="province"]').val()
  140. city = $('[name="city"]').val()
  141. district = $('[name="district"]').val()
  142. town = $('[name="town"]').val($('.form_send__select').text())
  143. address = $('[name="address"]').val().trim()
  144. if (!consignee) {
  145. tips('请填写你的姓名!')
  146. return false
  147. }
  148. if (!mobile) {
  149. tips('请填写你的手机号码!')
  150. return false
  151. }
  152. if (!/1[0-9]{10}/.test(mobile)) {
  153. tips('请填写正确的手机号码!')
  154. return false
  155. }
  156. console.log('province====', province)
  157. console.log('city====', city)
  158. console.log('district====', district)
  159. console.log('town====', town)
  160. console.log('address====', address)
  161. console.log('form_send__select====', $('.form_send__select').text())
  162. if (!province || !city || !district || !town || !address) {
  163. tips('请填写你的地址!')
  164. return false
  165. }
  166. }
  167. $('.duihuanShadow').show()
  168. })
  169. $('.duihuan_cancel').click(function () {
  170. $('.duihuanShadow').hide()
  171. })
  172. $('.duihuan_queren').click(function () {
  173. $('.duihuanShadow').hide()
  174. exchangeGoods({
  175. goods_id: goodsId,
  176. order_id: '{$order.order_id}',
  177. consignee: consignee,
  178. mobile: mobile,
  179. country: country,
  180. province: province,
  181. city: city,
  182. district: district,
  183. town: town,
  184. address: address
  185. })
  186. })
  187. $('.duihuan_queren_v').click(function () {
  188. $('.duihuanShadow').hide()
  189. })
  190. // 充值卡
  191. $('#card').click(function () {
  192. $('#cardInfo').show()
  193. })
  194. </script>
  195. </block>