sellerRegulations.vue 7.8 KB

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