sellerRegulations.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. <template name="regulations">
  2. <view class="regulations-template">
  3. <view class="regulations-title" @tap.stop="hanldOperationConfim">
  4. <text class="text">售后条款</text>
  5. <view class="freight-right">
  6. <text class="text-l">{{regulaText}}</text>
  7. <text class="iconfont icon-xiayibu"></text>
  8. </view>
  9. </view>
  10. <!--底部选择模态层弹窗组件 -->
  11. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" >
  12. <!-- 遮罩层 -->
  13. <view class="mask"></view>
  14. <view class="layer">
  15. <view class="content">
  16. <view class="freight-ltitle">售后条款</view>
  17. <text class="iconfont icon-iconfontguanbi" @click="freightConfim"></text>
  18. <view class="freight-radio">
  19. <radio-group class="row-group" @change="radioChange">
  20. <label class="row-input">
  21. <view class="row-text noTk">无条款</view>
  22. <radio class="row-radio" value="无条款" color="#E15616"/>
  23. </label>
  24. <label class="row-input" v-for="(item, index) in regulaDatas" :key="index">
  25. <view class="row-text" @click="gotoConten(item.id)">{{item.name.length>15?item.name.substr(0,15)+'...':item.name}}</view>
  26. <radio class="row-radio" :value="item.name" :checked="index === current" color="#E15616"/>
  27. </label>
  28. </radio-group>
  29. </view>
  30. </view>
  31. <view class="btn">
  32. <view class="button add" @click="freightConfim">确定</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default{
  40. name:'regulations',
  41. props:{
  42. regulaDatas:{
  43. type:Array
  44. }
  45. },
  46. data(){
  47. return{
  48. regulaText:'无条款',
  49. freightMoney:0,
  50. specClass: '',//规格弹窗css类,控制开关动画
  51. }
  52. },
  53. watch: {
  54. regulaDatas: {
  55. handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
  56. this.regulaDatas = el
  57. },
  58. deep: true
  59. }
  60. },
  61. created() {
  62. },
  63. methods:{
  64. gotoConten(id){
  65. this.$api.navigateTo('/components/cm-module/creatOrder/sellConten?clauseId='+id)
  66. },
  67. radioChange(e){
  68. this.regulaText = e.target.value;
  69. },
  70. freightConfim(){//提交完成选择
  71. this.hideSpec()
  72. },
  73. hideSpec() {//关闭弹窗
  74. this.specClass = 'hide';
  75. setTimeout(() => {
  76. this.specClass = 'none';
  77. }, 200);
  78. },
  79. hanldOperationConfim(data){//显示弹窗
  80. this.specClass = 'show';
  81. this.freightMoney = this.hanldFreight
  82. },
  83. showTip(){//显示弹窗
  84. this.$emit('@showregulaAlert');
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .regulations-template{
  91. width: 100%;
  92. height: auto;
  93. background: #FFFFFF;
  94. float: left;
  95. margin-top: 24rpx;
  96. .regulations-title{
  97. width: 702rpx;
  98. padding: 0 24rpx;
  99. height: 88rpx;
  100. line-height: 88rpx;
  101. font-size: $font-size-28;
  102. color: $text-color;
  103. background: #FFFFFF;
  104. float: left;
  105. font-weight: bold;
  106. border-bottom: 1rpx solid #EBEBEB;
  107. .freight-left{
  108. float: left;
  109. .icon-yunfeishuoming{
  110. height: 100%;
  111. padding:15rpx;
  112. color: $color-system;
  113. font-weight: normal;
  114. }
  115. }
  116. .Tk{
  117. float: right;
  118. margin-right: 38rpx;
  119. font-size: $font-size-28;
  120. color: #666666;
  121. }
  122. .freight-right{
  123. float: right;
  124. color: #2A81FF;
  125. .text-l{
  126. margin-right: 20rpx;
  127. }
  128. .text{
  129. line-height: 88rpx;
  130. color: #ff0000;
  131. margin:0 20rpx;
  132. font-weight: normal;
  133. }
  134. .icon-xiayibu{
  135. line-height: 88rpx;
  136. color: #999999;
  137. font-weight: normal;
  138. }
  139. }
  140. }
  141. }
  142. .freight-ltitle{
  143. width: 100%;
  144. line-height: 60rpx;
  145. height: 60rpx;
  146. font-size: $font-size-34;
  147. color: #333333;
  148. text-align:center;
  149. }
  150. .icon-iconfontguanbi{
  151. position: absolute;
  152. top: 0;
  153. right: 0;
  154. font-size: 34rpx;
  155. color: #b2b2b2
  156. }
  157. .freight-radio{
  158. height: 66rpx;
  159. line-height: 66rpx;
  160. padding: 0 20rpx;
  161. .row-group{
  162. width: 100%;
  163. max-height: 460rpx;
  164. overflow: auto;
  165. }
  166. .row-input{
  167. height: 66rpx;
  168. line-height: 66rpx;
  169. width: 100%;
  170. display: block;
  171. }
  172. .row-radio{
  173. float: right;
  174. transform: scale(0.9);
  175. color: #b2b2b2;
  176. }
  177. .row-text{
  178. font-size: $font-size-28;
  179. color: #1890f9;
  180. float: left;
  181. &.noTk{
  182. color: #666666;
  183. }
  184. }
  185. }
  186. .freight-group{
  187. width: 100%;
  188. height: 88rpx;
  189. display: flex;
  190. border-bottom: 1px solid #FFFFFF;
  191. flex-direction: row;
  192. .text{
  193. display: block;
  194. flex: 1;
  195. line-height: 88rpx;
  196. font-size: $font-size-24;
  197. color: #999999;
  198. text-align: left;
  199. padding-left: 10rpx;
  200. }
  201. .group-from{
  202. flex: 1;
  203. height: 40rpx;
  204. padding: 20rpx;
  205. line-height: 40rpx;
  206. align-items: flex-start;
  207. font-size: $font-size-24;
  208. color: $text-color;
  209. background: #F7F7F7;
  210. border-radius: 14rpx;
  211. margin-bottom: 20rpx;
  212. margin-top: 10rpx;
  213. .form-input{
  214. height: 40rpx;
  215. line-height: 40rpx;
  216. flex-grow: 1;
  217. }
  218. }
  219. }
  220. /* 加入购物模态层*/
  221. @keyframes showPopup {
  222. 0% {
  223. opacity: 0;
  224. }
  225. 100% {
  226. opacity: 1;
  227. }
  228. }
  229. @keyframes hidePopup {
  230. 0% {
  231. opacity: 1;
  232. }
  233. 100% {
  234. opacity: 0;
  235. }
  236. }
  237. @keyframes showLayer {
  238. 0% {
  239. transform: translateY(0);
  240. }
  241. 100% {
  242. transform: translateY(-100%);
  243. }
  244. }
  245. @keyframes hideLayer {
  246. 0% {
  247. transform: translateY(-100%);
  248. }
  249. 100% {
  250. transform: translateY(0);
  251. }
  252. }
  253. @keyframes showAmnation {
  254. 0% {
  255. top: -12rpx;
  256. opacity: 0;
  257. }
  258. 50% {
  259. top: -60rpx;
  260. opacity: 1;
  261. }
  262. 100% {
  263. top: -100rpx;
  264. opacity: 0;
  265. }
  266. }
  267. @keyframes hideAmnation {
  268. 0% {
  269. top: -100rpx;
  270. opacity: 0;
  271. }
  272. 100% {
  273. top: -12rpx;
  274. opacity: 0;
  275. }
  276. }
  277. .popup {
  278. position: fixed;
  279. top: 0;
  280. width: 100%;
  281. height: 100%;
  282. z-index: 999;
  283. display: none;
  284. .mask{
  285. position: fixed;
  286. top: 0;
  287. width: 100%;
  288. height: 100%;
  289. z-index: 21;
  290. background-color: rgba(0, 0, 0, 0.6);
  291. }
  292. .layer {
  293. position: fixed;
  294. z-index: 22;
  295. bottom: -710rpx;
  296. width: 702rpx;
  297. padding: 24rpx 24rpx 36rpx 24rpx;
  298. height: 670rpx;
  299. border-radius: 20rpx 20rpx 0 0;
  300. background-color: #fff;
  301. display: flex;
  302. flex-wrap: wrap;
  303. align-content: space-between;
  304. .content {
  305. width: 100%;
  306. position: relative;
  307. }
  308. .btn {
  309. width: 100%;
  310. height: 88rpx;
  311. display: flex;
  312. .button {
  313. width: 702rpx;
  314. height: 88rpx;
  315. color: #fff;
  316. display: flex;
  317. align-items: center;
  318. justify-content: center;
  319. font-size: $font-size-28;
  320. border-radius: 14rpx;
  321. background: $btn-confirm;
  322. }
  323. }
  324. }
  325. &.show {
  326. display: block;
  327. .mask{
  328. animation: showPopup 0.2s linear both;
  329. }
  330. .layer {
  331. animation: showLayer 0.2s linear both;
  332. }
  333. }
  334. &.hide {
  335. display: block;
  336. .mask{
  337. animation: hidePopup 0.2s linear both;
  338. }
  339. .layer {
  340. animation: hideLayer 0.2s linear both;
  341. }
  342. }
  343. &.none {
  344. display: none;
  345. }
  346. &.service {
  347. .row {
  348. margin: 30upx 0;
  349. .title {
  350. font-size: 30upx;
  351. margin: 10upx 0;
  352. }
  353. .description {
  354. font-size: 28upx;
  355. color: #999;
  356. }
  357. }
  358. }
  359. .layer-smimg{
  360. width: 114rpx;
  361. height: 114rpx;
  362. float: left;
  363. border-radius: 10rpx;
  364. margin-right: 24rpx;
  365. image{
  366. width: 114rpx;
  367. height: 114rpx;
  368. border-radius: 10rpx;
  369. }
  370. }
  371. .layer-nunbox{
  372. justify-content: space-between;
  373. align-items: center;
  374. width: 536rpx;
  375. height: 88rpx;
  376. padding: 13rpx 0 0 0;
  377. float: left;
  378. .layer-nunbox-t{
  379. width: 100%;
  380. height:44rpx;
  381. position:relative;
  382. display: flex;
  383. .layer-nunbox-text{
  384. line-height: 44rpx;
  385. font-size: $font-size-28;
  386. }
  387. .number-box{
  388. display: flex;
  389. justify-content: center;
  390. align-items: center;
  391. .iconfont{
  392. font-size: $font-size-32;
  393. padding:0 20rpx;
  394. font-size: $text-color;
  395. }
  396. .btn-input{
  397. width: 62rpx;
  398. height: 48rpx;
  399. line-height: 48rpx;
  400. background: #F8F8F8;
  401. border-radius: 4rpx;
  402. text-align: center;
  403. font-size: $font-size-28;
  404. }
  405. }
  406. .product-step{
  407. position: absolute;
  408. left: 45rpx;
  409. bottom: 0;
  410. height: 44rpx;
  411. background: #FFFFFF;
  412. }
  413. }
  414. .layer-nunbox-b{
  415. width: 100%;
  416. height:44rpx;
  417. margin-top: 13rpx;
  418. }
  419. .text{
  420. line-height: 44rpx;
  421. font-size: $font-size-28;
  422. .p{
  423. color: #FF2A2A;
  424. }
  425. .p:first-child{
  426. margin-left: 30rpx;
  427. }
  428. .p.sm{
  429. font-size: $font-size-24;
  430. }
  431. }
  432. }
  433. }
  434. </style>