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