sellerRegulations.vue 8.0 KB

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