1. <template>
  2. <div class="write">
  3. <div class="adr" v-if="address" @click="adrList()">
  4. <i class="van-icon van-icon-arrow pos-right"></i>
  5. <div class="top">
  6. <img src="../../../assets/images/icon-adr.png" alt="" srcset="">
  7. {{address.receiver}} {{address.phone}}
  8. </div>
  9. <div class="btm">
  10. <!-- 山东省 青岛市 市南区 香港中路2号海航万邦中心33楼微众控股集团 -->
  11. {{address.province}} {{address.address}}
  12. </div>
  13. </div>
  14. <div class="address" v-else @click="addAdr()">
  15. <i class="van-icon van-icon-arrow pos-right"></i>
  16. 请添加收货地址
  17. </div>
  18. <ul class="list">
  19. <li>
  20. <a href="" class="pic_thumb">
  21. <img :src="detail.productUrl" alt="" srcset="">
  22. </a>
  23. <div class="cont">
  24. <div class="title">
  25. {{detail.productTitle}}
  26. </div>
  27. <p class="desc">
  28. <!-- 深空灰色 -->
  29. </p>
  30. <div class="btm">
  31. <span>{{detail.pointPrice}} 积分</span>
  32. <i>x {{detail.count}}</i>
  33. </div>
  34. </div>
  35. </li>
  36. </ul>
  37. <div class="fixed-btm">
  38. <span @click="buy()">确认支付</span>
  39. 合计:<i>{{getTotal()}}积分</i>
  40. </div>
  41. </div>
  42. </template>
  43.  
  44. <script>
  45. import { Card,Dialog } from 'vant';
  46. export default {
  47. data() {
  48. return {
  49. orderNo: '',
  50. detail: {},
  51. address: {},
  52. payTotal: 0,
  53. imageURL: 'https://img.yzcdn.cn/upload_files/2017/07/02/af5b9f44deaeb68000d7e4a711160c53.jpg'
  54. }
  55. },
  56. created: function() {
  57. // var that = this
  58. // window.addEventListener('popstate', function(e) {
  59. // that.$router.go(-1)
  60. // });
  61. },
  62. components: {
  63. [Card.name]: Card,
  64. [Dialog.name]: Dialog
  65. },
  66. mounted() {
  67. var that = this
  68. this.orderNo = this.$route.query.orderNo;
  69. this.$reqPost('/order/get-order-detail',{orderNo:this.orderNo}).then(function(res) {
  70. console.log(res.data.body[0])
  71. that.detail = res.data.body[0]
  72. }).catch(function(err) {
  73. console.log(err)
  74. })
  75.  
  76. this.$reqGet('/member-address/getdefault').then(function(res) {
  77. console.log(res.data.body)
  78. that.address = res.data.body
  79. if (!res.data.body) {
  80. that.$dialog.confirm({
  81. message: '您尚未填写收货地址,请填写收货地址',
  82. showConfirmButton: true,
  83. showCancelButton: true,
  84. }).then(function () {
  85. that.$router.push('/user/address/edit/-1')
  86. }).catch(function () {
  87. console.log('cancel')
  88. });
  89. }
  90. }).catch(function(err) {
  91. console.log(err)
  92. })
  93. },
  94. methods: {
  95. getTotal: function() {
  96. this.payTotal = this.detail.total;
  97. return this.payTotal
  98. },
  99. adrList: function() {
  100. this.$router.push('/user/address')
  101. },
  102. addAdr: function() {
  103. this.$router.push('/user/address/edit/-1')
  104. },
  105. buy: function() {
  106. var that = this;
  107. if (!that.address) {
  108. that.$dialog.confirm({
  109. message: '您尚未填写收货地址,请填写收货地址!',
  110. showConfirmButton: true,
  111. showCancelButton: true,
  112. }).then(function () {
  113. that.$router.push('/user/address/edit/-1')
  114. }).catch(function () {
  115. console.log('cancel')
  116. });
  117. // that.$toast('您尚未填写收货地址,请填写收货地址');
  118. return false;
  119. }
  120. this.$reqPost('/order/pay-order',{addressId:this.address.id,memberId:1,orderNo:this.detail.orderNo,payTotal:this.payTotal}).then(function(res) {
  121. console.log(res)
  122. if(res.data.success) {
  123. that.$router.replace({path: '/items/result',query: {point:that.payTotal,orderNo:that.detail.orderNo}})
  124. }
  125. }).catch(function(err) {
  126. console.log(err)
  127. })
  128. // this.$router.push('/')
  129. },
  130. // FentoYuan: function(num) {
  131. // return (num / 100).toFixed(0)
  132. // }
  133. },
  134.  
  135. destroyed () {
  136. this.$dialog.close()
  137. },
  138. beforeRouteLeave(to, from, next){
  139. this.$dialog.close()
  140. next();
  141. }
  142. }
  143. </script>
  144.  
  145. <style scoped>
  146. .write .adr {
  147. padding: 0.35rem;
  148. background: #fff;
  149. margin-bottom: 0.3rem;
  150. font-size: 0.42rem;
  151. position: relative;
  152. }
  153. .write .adr .top {
  154. height: 0.53rem;
  155. line-height: 0.53rem;
  156. margin-bottom: 0.35rem;
  157. }
  158. .write .adr img {
  159. display: block;
  160. float: left;
  161. width: 0.41rem;
  162. height: 0.53rem;
  163. margin-right: 0.36rem;
  164. }
  165. .write .adr .btm {
  166. padding-left: 0.77rem;
  167. }
  168. .write .adr .pos-right {
  169. position: absolute;
  170. right: 0.5rem;
  171. top: 0.7rem;
  172. }
  173. .write .address {
  174. height: 1.82rem;
  175. line-height: 1.82rem;
  176. margin-bottom: 0.28rem;
  177. background: #fff;
  178. padding: 0 0.5rem;
  179. font-size: 0.42rem;
  180. color: #666;
  181. position: relative;
  182. }
  183. .write .address .pos-right{
  184. position: absolute;
  185. right: 0.5rem;
  186. top: 0.7rem;
  187. }
  188. .write ul.list{
  189. background: #fff;
  190. }
  191. .write ul.list li{
  192. padding: 0.35rem;
  193. border-top:1px solid #f6f6f9;
  194. height: 3.3rem;
  195. position: relative;
  196. }
  197. .write .pic_thumb{
  198. width: 2.6rem;
  199. height: 2.6rem;
  200. top: 0.35rem;
  201. left: 0.35rem;
  202. position: absolute;
  203. }
  204. .write .pic_thumb img{
  205. max-width: 100%;
  206. max-height: 100%;
  207. border: none;
  208. }
  209. .write .cont {
  210. padding-left: 3rem;
  211. height: 2.6rem;
  212. }
  213. .write .cont .title {
  214. font-size: 0.42rem;
  215. font-weight: bold;
  216. padding-bottom: 0.2rem;
  217. height: 0.9rem;
  218. overflow: hidden;
  219. }
  220. .write .cont .desc {
  221. height: 0.5rem;
  222. margin: 0px;
  223. color: #b4b4b9;
  224. }
  225. .write .cont .btm {
  226. padding-top: 0.5rem;
  227. font-size: 0.42rem;
  228. }
  229. .write .cont .btm span {
  230. color: #ff8400;
  231. }
  232. .write .cont .btm i {
  233. float: right;
  234. font-style: normal;
  235. }
  236. .write .fixed-btm{
  237. position: fixed;
  238. bottom: 0;
  239. left: 0;
  240. right: 0;
  241. background: #fff;
  242. height: 50px;
  243. line-height: 50px;
  244. padding: 0 0.35rem;
  245. }
  246. .write .fixed-btm i {
  247. font-size: 0.42rem;
  248. color: #fd141d;
  249. font-style: normal;
  250. }
  251. .write .fixed-btm span {
  252. display: block;
  253. float: right;
  254. width: 4.29rem;
  255. height: 1.2rem;
  256. line-height: 1.2rem;
  257. text-align: center;
  258. color: #fff;
  259. background: #fd141d;
  260. border-radius: 0.6rem;
  261. margin-top: 0.15rem;
  262. }
  263. </style>

2、订单填写页面 /items/write?skuId=10&orderNo=201903211033410001的更多相关文章

  1. 用vue.js重构订单计算页面

    在很久很久以前做过一个很糟糕的订单结算页面,虽然里面各区域(收货地址)使用模块化加载,但是偶尔会遇到某个模块加载失败的问题导致订单提交的数据有误. 大致问题如下: 1. 每个模块都采用usercont ...

  2. iOS实现时间线列表效果(例如订单详情页面的效果)

    之前看到美团的订单详情页面很有特色,于是决定模仿一下这个效果. 其实就是简单的 TableView 技巧,下面我们就来一步一步实现它. 设计 TableViewCell 原型 子类化一个新的 UITa ...

  3. JAVAEE——宜立方商城12:购物车实现、订单确认页面展示

    1. 学习计划 第十二天: 1.购物车实现 2.订单确认页面展示 2. 购物车的实现 2.1. 功能分析 1.购物车是一个独立的表现层工程. 2.添加购物车不要求登录.可以指定购买商品的数量. 3.展 ...

  4. 3、支付结果 /items/result?point=1&orderNo=201903211035400001

    <template> <div> <div class="toppic"> <img src="../../../assets/ ...

  5. day86:luffy:前端发送请求生成订单&结算页面优惠劵的实现

    目录 1.前端发送请求生成订单 1.前端点击支付按钮生成订单 2.结算成功之后应该清除结算页面的数据 3.后端计算结算页面总原价格和总的真实价格并存到数据库订单表中 2.优惠劵 1.准备工作 2.前端 ...

  6. 1、detail页面 /items/detail/:id

    <template> <div class="item_detail"> <van-swipe :autoplay="3000" ...

  7. 阶段5 3.微服务项目【学成在线】_day04 页面静态化_20-页面静态化-静态化测试-填写页面DataUrl

    启动前端和后端.轮播图的数据url可以在这里修改. 找到列表页面的轮播图,然后点击编辑 随便更新一个地址测试 提交后数据再次编辑 发现url没有变化 在pageService里面update方法把更新 ...

  8. aspcms标签

    [newslist:date style=yy-m-d] 日期格式 {aspcms:sitepath}/Templates/{aspcms:defaulttemplate} 幻灯片标签{aspcms: ...

  9. AspCms标签手册

    网站通用标签 基本标签 {aspcms:sitepath} 网站终极目录(可放在二级目录,其它语言则在三级目录) {aspcms:languagepath} 语言目录 {aspcms:siteurl} ...

随机推荐

  1. js空数组

    首先我们定义一个空的数组: var a = [ ]; 数组a里面是空的没有值,接下来我们打印: console.log(!!a); 因为数组是空的,此处应该为false. 恰好相反,!!a为true. ...

  2. js中的Call()和apply()

    Call和apply,就是改变函数里面的this指向的方法. xxx.call()或xxx.apply() 特别强调下xxx必须是function,(普通函数,类,构造函数) var obj={ na ...

  3. 学习笔记TF040:多GPU并行

    TensorFlow并行,模型并行,数据并行.模型并行根据不同模型设计不同并行方式,模型不同计算节点放在不同硬伯上资源运算.数据并行,比较通用简便实现大规模并行方式,同时使用多个硬件资源计算不同bat ...

  4. MySQL Error--Error Code

    mysql error code(备忘) 1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件导 ...

  5. zombodb sql functions 说明

    zombodb 提供了好多方便的sql 函数工具类以及帮助函数 查看zombodb 版本zdb.version() select * from zdb.version(); version ----- ...

  6. Dynamics CRM Plug-in

    Plug-in 就是我们俗称的dll file 或者是assembly file. 里面有自定义的代码可以运行在服务器端 Plug-in Pipeline: 只有3个阶段可以做改动: Pre-Vali ...

  7. CANVAS笔记

    bglayer.add(bgimage) /*后面的层会覆盖前面的,所以要放在上面的,就要后面才添加!*/ bglayer.add(this.shape1) Layer.destroy() layer ...

  8. git grep的一些用法

    https://www.kernel.org/pub/software/scm/git/docs/git-grep.html   把所有本地分支包含某个字符的行列出来,把含有master的列出来 gi ...

  9. zabbix之 自定义内存使用率监控报警

    配置zabbix当内存剩余不足15%的时候触发报警   zabbix默认的剩余内存报警:Average Lack of available memory on server {HOST.NAME}{T ...

  10. ASP.NET 4.0 :MasterPage母版页的ClientIDMode属性

    在ASP.NET 4.0之前我们总是要为控件的ClientID头疼,比如明明一个叫lblName的Label放在一个叫做grd的GridView里面后,在页面上改Label的ID就变成了诸如grd_c ...